Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Date methods: toISOString, getDay, constructor
(version: 1)
Comparing performance of:
toISOString vs concat vs getDay vs new Date() vs new Date(string)
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
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>
Run tests (5)
Previous results
Fork
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!
Comments
Confirm delete:
Do you really want to delete benchmark?