diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-26 03:00:00 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-26 03:00:00 +0000 |
commit | de592d31b3e82b1ff938c46f3db8cb06a716062e (patch) | |
tree | 32af531b478fabff890ca7b7dee71ffccf744048 /base/trace_event.cc | |
parent | f5e3da4d564980a048f375cf1a824a01df03382a (diff) | |
download | chromium_src-de592d31b3e82b1ff938c46f3db8cb06a716062e.zip chromium_src-de592d31b3e82b1ff938c46f3db8cb06a716062e.tar.gz chromium_src-de592d31b3e82b1ff938c46f3db8cb06a716062e.tar.bz2 |
Change to Hi Res timers on Windows.
There are two parts of this:
1) TimeTicks:Now()
Don't call timeBeginPeriod() in all cases.
Use the new SystemMonitor class to watch battery on/off
transitions and use the timeBeginPeriod() only when we're
using the battery.
2) TimeTicks::UnreliableHiResNow()
Change this function from "UnreliableHiResNow()" to
"HiResNow()". We still use QPC, but we detect if we're
on AMD Athlon XP machines which fail on QPC. For those
systems, we fall back to TimeTicks::Now().
Updated tests to detect hardware specifics of timers.
Output of the test will contain lines such as these:
[ RUN ] TimeTicks.SubMillisecondTimers
Min timer is: 1us
[ OK ] TimeTicks.SubMillisecondTimers
[ RUN ] TimeTicks.TimeGetTimeCaps
timeGetTime range is 1 to 1000000ms
[ OK ] TimeTicks.TimeGetTimeCaps
[ RUN ] TimeTicks.QueryPerformanceFrequency
QueryPerformanceFrequency is 2394.18MHz
[ OK ] TimeTicks.QueryPerformanceFrequency
[ RUN ] TimeTicks.TimerPerformance
Time::Now: 0.11us per call
TimeTicks::Now: 0.09us per call
TimeTicks::HighResNow: 0.26us per call
[ OK ] TimeTicks.TimerPerformance
Review URL: http://codereview.chromium.org/4092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/trace_event.cc')
-rw-r--r-- | base/trace_event.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/trace_event.cc b/base/trace_event.cc index 4ed41d5..92939d5 100644 --- a/base/trace_event.cc +++ b/base/trace_event.cc @@ -136,7 +136,7 @@ void TraceLog::Trace(const std::string& name, return; #ifdef USE_UNRELIABLE_NOW - TimeTicks tick = TimeTicks::UnreliableHighResNow(); + TimeTicks tick = TimeTicks::HighResNow(); #else TimeTicks tick = TimeTicks::Now(); #endif |