Script Preparation code:
x
 
var date = new Date();
var dateString = date.toISOString();
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<10000; ++i) {
        toISOString(date);
    }
  • concat

     
    for (var i=0; i<10000; ++i) {
        concat(date);
    }
  • getDay

     
    for (var i=0; i<10000; ++i) {
        date.getDay()
    }
  • new Date()

     
    for (var i=0; i<10000; ++i) {
        new Date()
    }
  • new Date(string)

     
    for (var i=0; i<10000; ++i) {
        new Date(dateString)
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    toISOString
    concat
    getDay
    new Date()
    new Date(string)

    Fastest: N/A

    Slowest: N/A

Latest run results:

No previous run results

This benchmark does not have any results yet. Be the first one to run it!