[Webkit-unassigned] [Bug 37743] Remove dependency of jsCurrentTime() on currentTime()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 19 17:57:49 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37743


Dmitry Titov <dimich at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dimich at chromium.org




--- Comment #6 from Dmitry Titov <dimich at chromium.org>  2010-04-19 17:57:48 PST ---
(In reply to comment #5)
> (From update of attachment 53588 [details])
> This looks like a good fix, but I'm a little concerned about the existing
> function continuing to be called 'currentTime', since it does not return the
> current time!  'tickCount()', perhaps, or 'monotonicTime()'?  I'd suggest
> having caught this bug it'd be really good to change the name of that function
> (plus 'currentTimeMS' to match), to make its meaning a little clearer & prevent
> similar problems in the future.

I'm a bit puzzled. All the patch does is to add a synonym for currentTime,
calling it also currentUTCTime... They both now exist and return exactly the
same thing. Looking at the resulting code, it's not clear what is going on, and
unless the implementation for all platforms is actually coming in the next
patch, it creates confusing code.

It seems the better alternative would be to have a notion of time intervals
rather then absolute time for things like animations etc. Something like a
stopwatch. Then there is no question of what kind of time it is or whether or
not it changes based on user changing the time in the system. Something like:

Stopwatch stopwatch;
stopwatch.start();  // starts ticking at 0
...
stopwatch.getTime()  // returns current time
...
stopwatch.stop(); // stops advancing
stopwatch.reset(); // drops to 0 again

I could imagine currentTime to just continue to exist as today (no renaming
necessary), since it is actually returning UTC time, and perhaps gradually
switching animations etc to a non-absolute time interval source like a
stopwatch.

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



More information about the webkit-unassigned mailing list