OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 public: | 185 public: |
186 static const int64_t kMillisecondsPerSecond = 1000; | 186 static const int64_t kMillisecondsPerSecond = 1000; |
187 static const int64_t kMicrosecondsPerMillisecond = 1000; | 187 static const int64_t kMicrosecondsPerMillisecond = 1000; |
188 static const int64_t kMicrosecondsPerSecond = kMicrosecondsPerMillisecond * | 188 static const int64_t kMicrosecondsPerSecond = kMicrosecondsPerMillisecond * |
189 kMillisecondsPerSecond; | 189 kMillisecondsPerSecond; |
190 static const int64_t kMicrosecondsPerMinute = kMicrosecondsPerSecond * 60; | 190 static const int64_t kMicrosecondsPerMinute = kMicrosecondsPerSecond * 60; |
191 static const int64_t kMicrosecondsPerHour = kMicrosecondsPerMinute * 60; | 191 static const int64_t kMicrosecondsPerHour = kMicrosecondsPerMinute * 60; |
192 static const int64_t kMicrosecondsPerDay = kMicrosecondsPerHour * 24; | 192 static const int64_t kMicrosecondsPerDay = kMicrosecondsPerHour * 24; |
193 static const int64_t kMicrosecondsPerWeek = kMicrosecondsPerDay * 7; | 193 static const int64_t kMicrosecondsPerWeek = kMicrosecondsPerDay * 7; |
194 static const int64_t kNanosecondsPerMicrosecond = 1000; | 194 static const int64_t kNanosecondsPerMicrosecond = 1000; |
195 static const int64_t kNanosecondsPerMillisecond = kNanosecondsPerMicrosecond * | |
196 kMicrosecondsPerMillisecond; | |
197 static const int64_t kNanosecondsPerSecond = kNanosecondsPerMicrosecond * | 195 static const int64_t kNanosecondsPerSecond = kNanosecondsPerMicrosecond * |
198 kMicrosecondsPerSecond; | 196 kMicrosecondsPerSecond; |
199 | 197 |
200 // Contains the NULL time. Use Time::Now() to get the current time. | 198 // Contains the NULL time. Use Time::Now() to get the current time. |
201 Time() : us_(0) {} | 199 Time() : us_(0) {} |
202 | 200 |
203 // Returns true if the time object has not been initialized. | 201 // Returns true if the time object has not been initialized. |
204 bool IsNull() const { return us_ == 0; } | 202 bool IsNull() const { return us_ == 0; } |
205 | 203 |
206 // Returns true if the time object is the maximum time. | 204 // Returns true if the time object is the maximum time. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 int64_t ticks_; | 407 int64_t ticks_; |
410 }; | 408 }; |
411 | 409 |
412 inline TimeTicks operator+(const TimeDelta& delta, const TimeTicks& ticks) { | 410 inline TimeTicks operator+(const TimeDelta& delta, const TimeTicks& ticks) { |
413 return ticks + delta; | 411 return ticks + delta; |
414 } | 412 } |
415 | 413 |
416 } } // namespace v8::internal | 414 } } // namespace v8::internal |
417 | 415 |
418 #endif // V8_PLATFORM_TIME_H_ | 416 #endif // V8_PLATFORM_TIME_H_ |
OLD | NEW |