blob: b6ebc11a846f9414debd74f378e2d0cbfa609961 [file] [log] [blame]
phoglund@webrtc.org4cebe6c2012-11-07 13:37:19 +00001/*
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
15namespace webrtc {
16
17bool TickTime::_use_fake_clock = false;
18WebRtc_Word64 TickTime::_fake_ticks = 0;
19
20void TickTime::UseFakeClock(WebRtc_Word64 start_millisecond) {
21 _use_fake_clock = true;
22 _fake_ticks = MillisecondsToTicks(start_millisecond);
23}
24
25void TickTime::AdvanceFakeClock(WebRtc_Word64 milliseconds) {
26 assert(_use_fake_clock);
27 _fake_ticks += MillisecondsToTicks(milliseconds);
28}
29
30} // namespace webrtc