Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Diff between two dates
Figuring out the fastest way to get the minutes between two dates
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Luxon (from string)
226769.2 Ops/sec
Luxon (from existing DateTimes)
9864965.0 Ops/sec
Raw math
137661696.0 Ops/sec
HTML Preparation code:
<script src=" https://cdn.jsdelivr.net/npm/luxon@3.5.0/build/global/luxon.min.js "></script>
Script Preparation code:
window.ds = "2020-02-19T00:15:00+00:00"; window.jsDt = new Date(window.ds); window.luxonDt = luxon.DateTime.fromISO(window.ds); window.dMillis = window.luxonDt.toMillis(); window.dMins = dMillis / (1000 * 60) window.ds2 = "2020-02-19T12:45:00+00:00"; window.jsDt2 = new Date(window.ds2); window.luxonDt2 = luxon.DateTime.fromISO(window.ds2); window.dMillis2 = window.luxonDt2.toMillis(); window.dMins2 = dMillis2 / (1000 * 60) // console.log(window.dMillis2 - window.dMillis)
Tests:
Luxon (from string)
luxon.DateTime.fromISO(window.ds2).diff(luxon.DateTime.fromISO(window.ds), 'minutes').minutes
Luxon (from existing DateTimes)
window.luxonDt2.diff(window.luxonDt.diff, 'minutes').minutes
Raw math (from minutes)
window.dMins2 - window.dMins
Raw math (from milliseconds)
(window.dMillis2 - window.dMillis) / 60000
Javascript date time object (string parsing)
(new Date(window.ds2) - new Date(window.ds)) / 60000
Javascript date time object (already created)
(window.jsDt - window.jsDt2) / 60000