phoglund@webrtc.org | 4cebe6c | 2012-11-07 13:37:19 +0000 | [diff] [blame] | 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 "system_wrappers/interface/tick_util.h" |
| 12 | |
| 13 | #include <cassert> |
| 14 | |
| 15 | namespace webrtc { |
| 16 | |
| 17 | bool TickTime::_use_fake_clock = false; |
| 18 | WebRtc_Word64 TickTime::_fake_ticks = 0; |
| 19 | |
| 20 | void TickTime::UseFakeClock(WebRtc_Word64 start_millisecond) { |
| 21 | _use_fake_clock = true; |
| 22 | _fake_ticks = MillisecondsToTicks(start_millisecond); |
| 23 | } |
| 24 | |
| 25 | void TickTime::AdvanceFakeClock(WebRtc_Word64 milliseconds) { |
| 26 | assert(_use_fake_clock); |
| 27 | _fake_ticks += MillisecondsToTicks(milliseconds); |
| 28 | } |
| 29 | |
| 30 | } // namespace webrtc |