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

Side by Side Diff: base/time_win.cc

Issue 200093: Make int64 -> Time conversion explicit.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « base/time.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 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Windows Timer Primer 6 // Windows Timer Primer
7 // 7 //
8 // A good article: http://www.ddj.com/windows/184416651 8 // A good article: http://www.ddj.com/windows/184416651
9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258 9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258
10 // 10 //
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 // Calculate the time elapsed since we started our timer 183 // Calculate the time elapsed since we started our timer
184 TimeDelta elapsed = ticks - initial_ticks; 184 TimeDelta elapsed = ticks - initial_ticks;
185 185
186 // Check if enough time has elapsed that we need to resync the clock. 186 // Check if enough time has elapsed that we need to resync the clock.
187 if (elapsed.InMilliseconds() > kMaxMillisecondsToAvoidDrift) { 187 if (elapsed.InMilliseconds() > kMaxMillisecondsToAvoidDrift) {
188 InitializeClock(); 188 InitializeClock();
189 continue; 189 continue;
190 } 190 }
191 191
192 return Time(elapsed + initial_time); 192 return Time(elapsed + Time(initial_time));
193 } 193 }
194 } 194 }
195 195
196 // static 196 // static
197 Time Time::NowFromSystemTime() { 197 Time Time::NowFromSystemTime() {
198 // Force resync. 198 // Force resync.
199 InitializeClock(); 199 InitializeClock();
200 return Time(initial_time); 200 return Time(initial_time);
201 } 201 }
202 202
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 // static 441 // static
442 TimeTicks TimeTicks::Now() { 442 TimeTicks TimeTicks::Now() {
443 return TimeTicks() + Singleton<NowSingleton>::get()->Now(); 443 return TimeTicks() + Singleton<NowSingleton>::get()->Now();
444 } 444 }
445 445
446 // static 446 // static
447 TimeTicks TimeTicks::HighResNow() { 447 TimeTicks TimeTicks::HighResNow() {
448 return TimeTicks() + Singleton<HighResNowSingleton>::get()->Now(); 448 return TimeTicks() + Singleton<HighResNowSingleton>::get()->Now();
449 } 449 }
OLDNEW
« no previous file with comments | « base/time.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698