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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Browser:
Chrome 144
Operating system:
Linux
Device Platform:
Desktop
Date tested:
8 months ago
Benchmark engine:
Benchmark.js
using Date
24K/s
Using Intl.DateTimeFormat
15K/s
View exact numbers
Test name
Executions per second
✓
using Date
24,374 Ops/sec
Using Intl.DateTimeFormat
15,119 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);