Script Preparation code:
x
 
var date = new Date();
function toISOString(date) {
    return date.toISOString();
}
function concat(date) {
    var d = date.getDate();
    var m = date.getMonth() + 1;
    var y = date.getFullYear();
    var day = d <= 9 ? '0' + d : '' + d;
    var month = m <= 9 ? '0' + m : '' + m;
    var year = '' + y;
    return day + '-' + month + '-' + year;
}
Tests:
  • toISOString

     
    for (var i=0; i<1000; ++i) {
        toISOString(date);
    }
  • concat

     
    for (var i=0; i<1000; ++i) {
        concat(date);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    toISOString
    concat

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Chrome 90 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
toISOString 1650.7 Ops/sec
concat 6219.9 Ops/sec