| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2005 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2005 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 kNumNanosecsPerSec / kNumMillisecsPerSec; | 28 kNumNanosecsPerSec / kNumMillisecsPerSec; |
| 29 static const int64_t kNumNanosecsPerMicrosec = | 29 static const int64_t kNumNanosecsPerMicrosec = |
| 30 kNumNanosecsPerSec / kNumMicrosecsPerSec; | 30 kNumNanosecsPerSec / kNumMicrosecsPerSec; |
| 31 | 31 |
| 32 typedef uint32_t TimeStamp; | 32 typedef uint32_t TimeStamp; |
| 33 | 33 |
| 34 // Returns the current time in milliseconds in 32 bits. | 34 // Returns the current time in milliseconds in 32 bits. |
| 35 uint32_t Time32(); | 35 uint32_t Time32(); |
| 36 | 36 |
| 37 // Returns the current time in milliseconds in 64 bits. | 37 // Returns the current time in milliseconds in 64 bits. |
| 38 int64_t Time64(); | 38 int64_t TimeMillis(); |
| 39 | 39 |
| 40 // Returns the current time in milliseconds. | 40 // Returns the current time in milliseconds. |
| 41 // TODO(honghaiz): Returns Time64 once majority of the webrtc code migrates to | 41 // TODO(honghaiz): Change to return TimeMillis() once majority of the webrtc |
| 42 // 64-bit timestamp. | 42 // code migrates to 64-bit timestamp. |
| 43 inline uint32_t Time() { | 43 inline uint32_t Time() { |
| 44 return Time32(); | 44 return Time32(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Returns the current time in microseconds. | 47 // Returns the current time in microseconds. |
| 48 uint64_t TimeMicros(); | 48 uint64_t TimeMicros(); |
| 49 // Returns the current time in nanoseconds. | 49 // Returns the current time in nanoseconds. |
| 50 uint64_t TimeNanos(); | 50 uint64_t TimeNanos(); |
| 51 | 51 |
| 52 // Returns a future timestamp, 'elapsed' milliseconds from now. | 52 // Returns a future timestamp, 'elapsed' milliseconds from now. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // Convert from std::tm, which is relative to 1900-01-01 00:00 to number of | 97 // Convert from std::tm, which is relative to 1900-01-01 00:00 to number of |
| 98 // seconds from 1970-01-01 00:00 ("epoch"). Don't return time_t since that | 98 // seconds from 1970-01-01 00:00 ("epoch"). Don't return time_t since that |
| 99 // is still 32 bits on many systems. | 99 // is still 32 bits on many systems. |
| 100 int64_t TmToSeconds(const std::tm& tm); | 100 int64_t TmToSeconds(const std::tm& tm); |
| 101 | 101 |
| 102 } // namespace rtc | 102 } // namespace rtc |
| 103 | 103 |
| 104 #endif // WEBRTC_BASE_TIMEUTILS_H_ | 104 #endif // WEBRTC_BASE_TIMEUTILS_H_ |
| OLD | NEW |