from JSC to all others: preciseTime global function ?

Andrea Giammarchi andrea.giammarchi at gmail.com
Thu Aug 16 04:42:28 PDT 2012


Quick one, since I have discovered this only recently via Object.keys(this)
in JSC ( JavaScriptCore )

double <= preciseTime()

returns a double number with seconds and microseconds, e.g.

12334556.123456

is basically the same of doing (new Date / 1000) except the precision is up
to 1000000.

in Java/Rhino, System.nanoTime() / 1000000000 would produce similar result,
but I found preciseTime() accurate enough but not as slow as nanoTime
historically is ( greedy in clocks )

Is ES6 considering this function? I find hilarious that all JS benchmarks
out there are basically asking browsers to enable a Java Applet in order to
have better precision ( without considering that both binding and callback
are more expensive than any +new Date call )

Thanks for any sort of answer.

Best Regards,
    Andrea Giammarchi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120816/68867965/attachment-0001.html>


More information about the es-discuss mailing list