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

Revision 26 of this benchmark created by Mike Gleason on


Description

Checking the speed of Moment.js with different options.

Preparation HTML

<script src="https://rawgithub.com/timrwood/moment/2.0.0/moment.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Date
var d = new Date();
ready
Moment.js without format
m=moment();
ready
Date with format
var d = new Date();
var s = d.getMonth() + "/" + d.getDay() + "/" + d.getFullYear();
ready
Moment.js with format
m=moment();
var s = m.format("M/D/YY");
ready

Revisions

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