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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 private: | 101 private: |
102 uint32_t last_ts_; | 102 uint32_t last_ts_; |
103 int64_t num_wrap_; | 103 int64_t num_wrap_; |
104 }; | 104 }; |
105 | 105 |
106 // Convert from std::tm, which is relative to 1900-01-01 00:00 to number of | 106 // Convert from std::tm, which is relative to 1900-01-01 00:00 to number of |
107 // seconds from 1970-01-01 00:00 ("epoch"). Don't return time_t since that | 107 // seconds from 1970-01-01 00:00 ("epoch"). Don't return time_t since that |
108 // is still 32 bits on many systems. | 108 // is still 32 bits on many systems. |
109 int64_t TmToSeconds(const std::tm& tm); | 109 int64_t TmToSeconds(const std::tm& tm); |
110 | 110 |
| 111 // Return the number of microseconds since January 1, 1970, UTC. |
| 112 // Useful mainly when producing logs to be correlated with other |
| 113 // devices, and when the devices in question all have properly |
| 114 // synchronized clocks. |
| 115 // |
| 116 // Note that this function obeys the system's idea about what the time |
| 117 // is. It is not guaranteed to be monotonic; it will jump in case the |
| 118 // system time is changed, e.g., by some other process calling |
| 119 // settimeofday. Always use rtc::TimeMicros(), not this function, for |
| 120 // measuring time intervals and timeouts. |
| 121 int64_t TimeUTCMicros(); |
| 122 |
111 } // namespace rtc | 123 } // namespace rtc |
112 | 124 |
113 #endif // WEBRTC_BASE_TIMEUTILS_H_ | 125 #endif // WEBRTC_BASE_TIMEUTILS_H_ |
OLD | NEW |