summaryrefslogtreecommitdiffstats
path: root/base/time_posix.cc
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-26 03:00:00 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-26 03:00:00 +0000
commitde592d31b3e82b1ff938c46f3db8cb06a716062e (patch)
tree32af531b478fabff890ca7b7dee71ffccf744048 /base/time_posix.cc
parentf5e3da4d564980a048f375cf1a824a01df03382a (diff)
downloadchromium_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/time_posix.cc')
-rw-r--r--base/time_posix.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/time_posix.cc b/base/time_posix.cc
index 88c49a2..18dc240 100644
--- a/base/time_posix.cc
+++ b/base/time_posix.cc
@@ -137,6 +137,6 @@ TimeTicks TimeTicks::Now() {
}
// static
-TimeTicks TimeTicks::UnreliableHighResNow() {
+TimeTicks TimeTicks::HighResNow() {
return Now();
}