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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
without Intl.DateTimeFormat
91101384.0 Ops/sec
with Intl.DateTimeFormat
797895.8 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));