Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Intl.DateTimeFormat
Comparing 2 dates with Intl.DateTimeFormat vs using Date.get* methods
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/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
without Intl.DateTimeFormat
2595713.5 Ops/sec
with Intl.DateTimeFormat
653809.7 Ops/sec
Script Preparation code:
var x = new Date('5/11/2018'); var y = new Date('5/11/2018'); var dateOptions = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var dateTimeFormat = new Intl.DateTimeFormat('en-US', dateOptions);
Tests:
without Intl.DateTimeFormat
var z = (x.getFullYear() === y.getFullYear() && x.getMonth() === y.getMonth() && x.getDate() === y.getDate());
with Intl.DateTimeFormat
var z = (dateTimeFormat.format(x) === dateTimeFormat.format(y));