OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 TimeTicks TimeTicks::Now() { | 482 TimeTicks TimeTicks::Now() { |
483 return TimeTicks() + now_function(); | 483 return TimeTicks() + now_function(); |
484 } | 484 } |
485 | 485 |
486 // static | 486 // static |
487 TimeTicks TimeTicks::HighResNow() { | 487 TimeTicks TimeTicks::HighResNow() { |
488 return TimeTicks() + HighResNowSingleton::GetInstance()->Now(); | 488 return TimeTicks() + HighResNowSingleton::GetInstance()->Now(); |
489 } | 489 } |
490 | 490 |
491 // static | 491 // static |
| 492 bool TimeTicks::IsHighResNowFastAndReliable() { |
| 493 return CPUReliablySupportsHighResTime(); |
| 494 } |
| 495 |
| 496 // static |
492 TimeTicks TimeTicks::ThreadNow() { | 497 TimeTicks TimeTicks::ThreadNow() { |
493 NOTREACHED(); | 498 NOTREACHED(); |
494 return TimeTicks(); | 499 return TimeTicks(); |
495 } | 500 } |
496 | 501 |
497 // static | 502 // static |
498 TimeTicks TimeTicks::NowFromSystemTraceTime() { | 503 TimeTicks TimeTicks::NowFromSystemTraceTime() { |
499 return HighResNow(); | 504 return HighResNow(); |
500 } | 505 } |
501 | 506 |
(...skipping 21 matching lines...) Expand all Loading... |
523 } | 528 } |
524 } | 529 } |
525 | 530 |
526 // TimeDelta ------------------------------------------------------------------ | 531 // TimeDelta ------------------------------------------------------------------ |
527 | 532 |
528 // static | 533 // static |
529 TimeDelta TimeDelta::FromQPCValue(LONGLONG qpc_value) { | 534 TimeDelta TimeDelta::FromQPCValue(LONGLONG qpc_value) { |
530 return TimeDelta( | 535 return TimeDelta( |
531 HighResNowSingleton::GetInstance()->QPCValueToMicroseconds(qpc_value)); | 536 HighResNowSingleton::GetInstance()->QPCValueToMicroseconds(qpc_value)); |
532 } | 537 } |
OLD | NEW |