Date comparison benchmarks

JavaScript performance comparison

Test case created by twilco

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  let aStr = "2018-11-30T05:07:14Z";
  let bStr = "2018-11-30T05:11:51Z";

};
</script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Simple comparison
let a = new Date(aStr);
let b = new Date(bStr);
let result = a > b ? 1 : (a < b ? -1 : 0)
pending…
getTime() comparison
let a = new Date(aStr);
let b = new Date(bStr);
let result = a.getTime() > b.getTime() ? 1 : (a.getTime() < b.getTime() ? -1 : 0)
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