Chromium Code Reviews| Index: base/time/time_win.cc |
| diff --git a/base/time/time_win.cc b/base/time/time_win.cc |
| index 8708eb21c90697112771f8a31a4490fa43ebd127..dfe4af37b589d3380e3de523a3b13b38795c23dd 100644 |
| --- a/base/time/time_win.cc |
| +++ b/base/time/time_win.cc |
| @@ -504,6 +504,26 @@ bool TimeTicks::IsHighResolution() { |
| } |
| // static |
| +bool TimeTicks::IsConsistentAcrossProcesses() { |
| + // According to Windows documentation [1] QPC is consistent Post-Windows Visa. |
|
Lei Zhang
2016/07/07 20:36:30
Visa -> Vista?
majidvp
2016/07/08 15:38:22
Done.
|
| + // So if we are using QPC then we are consistent which is the same as being |
| + // high resolution. |
| + // |
| + // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx |
| + // |
| + // "In general, the performance counter results are consistent across all |
| + // processors in multi-core and multi-processor systems, even when measured on |
| + // different threads or processes. Here are some exceptions to this rule: |
| + // - Pre-Windows Vista operating systems that run on certain processors might |
| + // violate this consistency because of one of these reasons: |
| + // 1. The hardware processors have a non-invariant TSC and the BIOS |
| + // doesn't indicate this condition correctly. |
| + // 2. The TSC synchronization algorithm that was used wasn't suitable for |
| + // systems with large numbers of processors." |
| + return IsHighResolution(); |
| +} |
| + |
| +// static |
| TimeTicks::Clock TimeTicks::GetClock() { |
| return IsHighResolution() ? |
| Clock::WIN_QPC : Clock::WIN_ROLLOVER_PROTECTED_TIME_GET_TIME; |