Bug 119762

Summary: Replace currentTime() with monotonicallyIncreasingTime() in WTF and JavaScriptCore
Product: WebKit Reporter: Arunprasad Rajkumar <arurajku>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ararunprasad, benjamin, cmarcelo, commit-queue, darin, ggaren, kling, rniwa, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 119761    
Attachments:
Description Flags
Patch none

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.