Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
moment clone vs new date
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0
Browser:
Firefox 149
Operating system:
Windows
Device Platform:
Desktop
Date tested:
20 days ago
Test name
Executions per second
new Date()
15012717.0 Ops/sec
Moment
181940.1 Ops/sec
HTML Preparation code:
<script src="https://cdn.rawgit.com/moment/moment/2.7.0/moment.js"></script> <script src="https://cdn.rawgit.com/moment/moment-timezone/0.2.2/builds/moment-timezone-with-data.js"></script></script>
Script Preparation code:
const DIFF_SEC = 600; const DIFF_MS = 600000; const TIMESTAMP = '2023-01-01T00:00:00Z';
Tests:
new Date()
const t1 = new Date(TIMESTAMP); const t2 = new Date(t1.getTime() + DIFF_MS);
Moment
moment.utc(TIMESTAMP).clone().add(DIFF_SEC, 'seconds')