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

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

Issue 2290203002: Delete Timing class, timing.h, and update all users. (Closed)
Patch Set: Fix copy-paste error in rtpdataengine.cc. Created 4 years, 3 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/timing.h ('k') | webrtc/media/base/rtpdataengine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2008 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/base/timing.h"
12 #include "webrtc/base/timeutils.h"
13
14 #if defined(WEBRTC_POSIX)
15 #include <errno.h>
16 #include <math.h>
17 #include <sys/time.h>
18 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
19 #include <mach/mach.h>
20 #include <mach/clock.h>
21 #endif
22 #elif defined(WEBRTC_WIN)
23 #include <sys/timeb.h>
24 #endif
25
26 namespace rtc {
27
28 Timing::Timing() {}
29
30 Timing::~Timing() {}
31
32 // static
33 double Timing::WallTimeNow() {
34 #if defined(WEBRTC_POSIX)
35 struct timeval time;
36 gettimeofday(&time, NULL);
37 // Convert from second (1.0) and microsecond (1e-6).
38 return (static_cast<double>(time.tv_sec) +
39 static_cast<double>(time.tv_usec) * 1.0e-6);
40
41 #elif defined(WEBRTC_WIN)
42 struct _timeb time;
43 _ftime(&time);
44 // Convert from second (1.0) and milliseconds (1e-3).
45 return (static_cast<double>(time.time) +
46 static_cast<double>(time.millitm) * 1.0e-3);
47 #endif
48 }
49
50 double Timing::TimerNow() {
51 return (static_cast<double>(TimeNanos()) / kNumNanosecsPerSec);
52 }
53
54 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/timing.h ('k') | webrtc/media/base/rtpdataengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698