| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #else | 75 #else |
| 76 #error Unsupported platform. | 76 #error Unsupported platform. |
| 77 #endif | 77 #endif |
| 78 return ticks; | 78 return ticks; |
| 79 } | 79 } |
| 80 | 80 |
| 81 uint32_t Time32() { | 81 uint32_t Time32() { |
| 82 return static_cast<uint32_t>(TimeNanos() / kNumNanosecsPerMillisec); | 82 return static_cast<uint32_t>(TimeNanos() / kNumNanosecsPerMillisec); |
| 83 } | 83 } |
| 84 | 84 |
| 85 int64_t Time64() { | 85 int64_t TimeMillis() { |
| 86 return static_cast<int64_t>(TimeNanos() / kNumNanosecsPerMillisec); | 86 return static_cast<int64_t>(TimeNanos() / kNumNanosecsPerMillisec); |
| 87 } | 87 } |
| 88 | 88 |
| 89 uint64_t TimeMicros() { | 89 uint64_t TimeMicros() { |
| 90 return static_cast<uint64_t>(TimeNanos() / kNumNanosecsPerMicrosec); | 90 return static_cast<uint64_t>(TimeNanos() / kNumNanosecsPerMicrosec); |
| 91 } | 91 } |
| 92 | 92 |
| 93 uint32_t TimeAfter(int32_t elapsed) { | 93 uint32_t TimeAfter(int32_t elapsed) { |
| 94 RTC_DCHECK_GE(elapsed, 0); | 94 RTC_DCHECK_GE(elapsed, 0); |
| 95 RTC_DCHECK_LT(static_cast<uint32_t>(elapsed), HALF); | 95 RTC_DCHECK_LT(static_cast<uint32_t>(elapsed), HALF); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (expiry_in_leap_year && month <= 2 - 1) // |month| is zero based. | 174 if (expiry_in_leap_year && month <= 2 - 1) // |month| is zero based. |
| 175 day -= 1; | 175 day -= 1; |
| 176 | 176 |
| 177 // Combine all variables into seconds from 1970-01-01 00:00 (except |month| | 177 // Combine all variables into seconds from 1970-01-01 00:00 (except |month| |
| 178 // which was accumulated into |day| above). | 178 // which was accumulated into |day| above). |
| 179 return (((static_cast<int64_t> | 179 return (((static_cast<int64_t> |
| 180 (year - 1970) * 365 + day) * 24 + hour) * 60 + min) * 60 + sec; | 180 (year - 1970) * 365 + day) * 24 + hour) * 60 + min) * 60 + sec; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace rtc | 183 } // namespace rtc |
| OLD | NEW |