Bug 119762 - Replace currentTime() with monotonicallyIncreasingTime() in WTF and JavaScriptCore
Summary: Replace currentTime() with monotonicallyIncreasingTime() in WTF and JavaScrip...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 119761
  Show dependency treegraph
 
Reported: 2013-08-13 11:16 PDT by Arunprasad Rajkumar
Modified: 2013-08-15 10:06 PDT (History)
9 users (show)

See Also:


Attachments
Patch (6.37 KB, patch)
2013-08-13 11:19 PDT, Arunprasad Rajkumar
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arunprasad Rajkumar 2013-08-13 11:16:14 PDT
Replace currentTime() with monotonicallyIncreasingTime() in WTF and JavaScriptCore [at appropriate places]
Comment 1 Arunprasad Rajkumar 2013-08-13 11:19:38 PDT
Created attachment 208657 [details]
Patch
Comment 2 Geoffrey Garen 2013-08-13 11:26:33 PDT
Why?
Comment 3 Arunprasad Rajkumar 2013-08-13 12:12:16 PDT
(In reply to comment #2)
> Why?

Actually some platforms(mostly embedded systems like TV/STB) doesn't have battery powered reliable clock source. Wall Clock time is obtained via time sources like NTP(it may have some latency). So I feel use currentTime() only on the places which really needs wall clock time(like jsDateTime()), remaining places monotonicallyIncreasingTime() is good.
Comment 4 Geoffrey Garen 2013-08-13 15:44:56 PDT
Are you saying that monotonicallyIncreasingTime() is faster than currentTime()? If so, how did you measure that?
Comment 5 Darin Adler 2013-08-13 16:40:44 PDT
(In reply to comment #4)
> Are you saying that monotonicallyIncreasingTime() is faster than currentTime()? If so, how did you measure that?

No he’s not saying that.

He’s saying that on his platform, monotonicallyIncreasingTime has higher resolution than currentTime.
Comment 6 Geoffrey Garen 2013-08-13 17:27:03 PDT
Comment on attachment 208657 [details]
Patch

r=me
Comment 7 Geoffrey Garen 2013-08-13 17:27:18 PDT
Thanks.
Comment 8 WebKit Commit Bot 2013-08-13 17:50:19 PDT
Comment on attachment 208657 [details]
Patch

Clearing flags on attachment: 208657

Committed r154032: <http://trac.webkit.org/changeset/154032>
Comment 9 WebKit Commit Bot 2013-08-13 17:50:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Simon Fraser (smfr) 2013-08-13 18:19:03 PDT
The changelog and commit message should have explained the "why".
Comment 11 Arunprasad Rajkumar 2013-08-13 22:59:25 PDT
(In reply to comment #10)
> The changelog and commit message should have explained the "why".

Simon, sorry for not including details. I will add more details while doing the change for WebCore.(Or is it possible to change the commit message?)
Comment 12 Darin Adler 2013-08-14 10:20:11 PDT
I think comments in the header with monotonicallyIncreasingTime and currentTime should explain the guidelines for when to use each. That’s where the “why” would go.