Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Intl.DateTimeFormat performance edit
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
using Date
9K/s
Using Intl.DateTimeFormat
9K/s
View exact numbers
Test name
Executions per second
✓
using Date
9,269 Ops/sec
Using Intl.DateTimeFormat
8,974 Ops/sec
Script Preparation code:
var now = new Date() var targetHour = 9 var timezone = 'America/Toronto'
Tests:
Using Intl.DateTimeFormat
const formatter = new Intl.DateTimeFormat(undefined, { timeZone: timezone, hour: 'numeric', minute: 'numeric', second: 'numeric', }) const currentTime = formatter.format(now) // Extract the hour part and convert it to a number const currentHour = parseInt(currentTime.split(':')[0], 10)
using Date
const currentTime = now.toLocaleTimeString('en-US', { timeZone: timezone, hour12: false }); // Extract the hour part and convert it to a number const currentHour = parseInt(currentTime.split(':')[0], 10);