| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #include "webrtc/system_wrappers/include/tick_util.h" | |
| 12 | |
| 13 #include "webrtc/base/timeutils.h" | |
| 14 | |
| 15 namespace webrtc { | |
| 16 | |
| 17 int64_t TickTime::MillisecondTimestamp() { | |
| 18 return TicksToMilliseconds(TickTime::Now().Ticks()); | |
| 19 } | |
| 20 | |
| 21 int64_t TickTime::MicrosecondTimestamp() { | |
| 22 return TicksToMicroseconds(TickTime::Now().Ticks()); | |
| 23 } | |
| 24 | |
| 25 int64_t TickTime::MillisecondsToTicks(const int64_t ms) { | |
| 26 return ms * rtc::kNumNanosecsPerMillisec; | |
| 27 } | |
| 28 | |
| 29 int64_t TickTime::TicksToMilliseconds(const int64_t ticks) { | |
| 30 return ticks / rtc::kNumNanosecsPerMillisec; | |
| 31 } | |
| 32 | |
| 33 int64_t TickTime::TicksToMicroseconds(const int64_t ticks) { | |
| 34 return ticks / rtc::kNumNanosecsPerMicrosec; | |
| 35 } | |
| 36 | |
| 37 // Gets the native system tick count, converted to nanoseconds. | |
| 38 int64_t TickTime::QueryOsForTicks() { | |
| 39 return rtc::TimeNanos(); | |
| 40 } | |
| 41 | |
| 42 } // namespace webrtc | |
| OLD | NEW |