Moment startOf Day vs string parsing (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.1/moment.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
js Date
var a = new Date();
var s = a.toString().slice(0,15);
return new Date(s).getTime()
ready
momnet date
var a = moment().startOf('day')
return a.unix();
ready

Revisions

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

  • Revision 1: published by Zachary Belford on
  • Revision 2: published by Zachary Belford on
  • Revision 3: published on
  • Revision 6: published by Dylan Robinson on