Intl.DateTimeFormat vs. Date.prototype.toLocaleTimeString()

Benchmark created on


Setup

const date = new Date('August 19, 1975 23:15:30 GMT+00:00')

const sharedDateFormat = new Intl.DateTimeFormat('en-US');

Test runner

Ready to run.

Testing in
TestOps/sec
Intl.DateTimeFormat using shared instance
const result = sharedDateFormat.format(date);
ready
Intl.DateTimeFormat using new instance each time
const dateFormat = new Intl.DateTimeFormat('en-US');
const result = dateFormat.format(date);
ready
Date.prototype.toLocaleTimeString()
const result = date.toLocaleTimeString('en-US');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.