Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: webrtc/base/timing.h

Issue 1895933003: Adding the ability to use a simulated clock for unit tests. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing compile warning. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/timeutils_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2008 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
11 #ifndef WEBRTC_BASE_TIMING_H_ 11 #ifndef WEBRTC_BASE_TIMING_H_
12 #define WEBRTC_BASE_TIMING_H_ 12 #define WEBRTC_BASE_TIMING_H_
13 13
14 namespace rtc { 14 namespace rtc {
15 15
16 // TODO(deadbeef): Remove this and use ClockInterface instead.
16 class Timing { 17 class Timing {
17 public: 18 public:
18 Timing(); 19 Timing();
19 virtual ~Timing(); 20 virtual ~Timing();
20 21
21 // WallTimeNow() returns the current wall-clock time in seconds, 22 // WallTimeNow() returns the current wall-clock time in seconds,
22 // within 10 milliseconds resolution. 23 // within 10 milliseconds resolution.
23 // WallTimeNow is static and does not require a timer_handle_ on Windows. 24 // WallTimeNow is static and does not require a timer_handle_ on Windows.
24 static double WallTimeNow(); 25 static double WallTimeNow();
25 26
26 // TimerNow() is like WallTimeNow(), but is monotonically 27 // TimerNow() is like WallTimeNow(), but is monotonically
27 // increasing. It returns seconds in resolution of 10 microseconds 28 // increasing. It returns seconds in resolution of 10 microseconds
28 // or better. Although timer and wall-clock time have the same 29 // or better. Although timer and wall-clock time have the same
29 // timing unit, they do not necessarily correlate because wall-clock 30 // timing unit, they do not necessarily correlate because wall-clock
30 // time may be adjusted backwards, hence not monotonic. 31 // time may be adjusted backwards, hence not monotonic.
31 // Made virtual so we can make a fake one. 32 // Made virtual so we can make a fake one.
32 // TODO(tommi): The only place we use this (virtual) is in 33 // TODO(tommi): The only place we use this (virtual) is in
33 // rtpdata_engine_unittest.cc. See if it doesn't make more sense to change 34 // rtpdata_engine_unittest.cc. See if it doesn't make more sense to change
34 // that contract or test than to modify this generic class. 35 // that contract or test than to modify this generic class.
35 virtual double TimerNow(); 36 virtual double TimerNow();
36 }; 37 };
37 38
38 } // namespace rtc 39 } // namespace rtc
39 40
40 #endif // WEBRTC_BASE_TIMING_H_ 41 #endif // WEBRTC_BASE_TIMING_H_
OLDNEW
« no previous file with comments | « webrtc/base/timeutils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698