[Webkit-unassigned] [Bug 20979] New: WebCore timers on Windows XP do not fire with high resolution

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 21 16:46:05 PDT 2008


           Summary: WebCore timers on Windows XP do not fire with high
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
               URL: http://ejohn.org/apps/timers/
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: P2
         Component: Platform
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sfalken at apple.com

Timers on XP are only firing at 16ms intervals.

On XP, the test at http://ejohn.org/apps/timers/ generates a line at 15-16ms.
On Vista, we get a line at 10ms, which is expected given our timer clamp (we
won't go any lower).

The bug is due to us not calling timeBeginPeriod/timeEndPeriod on XP, which we
weren't doing since it didn't have the desired effect by itself.  The reason it
wasn't working is that we're calling GetSystemTimeAsFileTime to retrieve the
current time (to decide which timers are ready to fire).  Turns out on XP, this
call is low resolution (15-16ms granularity), even when
timeBeginPeriod/timeEndPeriod is used.

To fix this, we need to call timeBeginPeriod/timeEndPeriod on all systems
(including both XP and Vista) and call through to our JSC high-resolution
date/time code instead of using GetSystemTimeAsFileTime.  

Note that we don't call timeBeginPeriod(1) and leave it there. Instead, we want
to fall back to low-resolution mode after 300ms or so to avoid overly taxing
the user's CPU.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list