Date vs Moment.js with(out) format (v18)

Revision 18 of this benchmark created by Evan Savage on


Description

Checking the speed of Moment.js with different options.

Preparation HTML

<script src="http://momentjs.com/downloads/moment.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Date
new Date('2011-09-23T20:40:55.999+0000');
ready
Moment.js without format
moment('2011-09-23T20:40:55.999+0000');
ready
Moment.js with format
moment('2011-09-23T20:40:55.999+0000',"YYYY-MM-DDTHH:mm:ss.SSSZ");
ready
Date with millis
new Date(1316810455999);
ready
Moment with millis
moment(1316810455999);
ready
Moment with Date with millis
moment(new Date(1316810455999));
ready
Moment with Date
moment(new Date('2011-09-23T20:40:55.999+0000'));
ready

Revisions

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