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; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
using Date
37K/s
Using Intl.DateTimeFormat
36K/s
View exact numbers
Test name
Executions per second
✓
using Date
36,901 Ops/sec
Using Intl.DateTimeFormat
35,689 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);