[webkit-dev] currentTime() and UTC time

Yong Li yong.li.webkit at gmail.com
Fri Apr 16 19:19:04 PDT 2010

Just raised a bug for this. Except the usage in jsCurrentTime(), all calls
to currentTime() in both JavaScriptCore (threading, TimeoutChecker,
ProfileNode...) and WebCore (Timer, and many other cases...) are time
counting and assume it never goes backward. If we make currentTime() return
the system UTC time (like gettimeofday), then it will break time counting
when system time is changed (e.g. by calling settimeofday()), and give
unexpected results. If we make currentTime() always increase, then after
user changes system time, the browser cannot provide correct JS Date until
being restarted.


2010/4/16 Yong Li <yong.li.webkit at gmail.com>

> Hi All
> The default implementation of JS Date is calling currentTime() (by
> jsCurrentTime()), so it assumes currentTime() returns current UTC time, and
> system UTC time can be changed. However, currentTime() is also used in most
> cases as a system tick count, which means it should always be monotonically
> increasing. I guess we should remove the dependency on currentTime() from JS
> Date to fix the confliction.
> Any idea?
> -Yong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100416/cfae7c87/attachment.html>

More information about the webkit-dev mailing list