10 char Unix timestamp

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var ts = new Date()
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Test using string slice
String((ts.getTime())).slice(0,10)
pending…
Test using math round
String(Math.round(ts.getTime() / 1000))
pending…
Test using floor
String(Math.floor(ts.getTime() / 1000))
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment