Date formatting

Benchmark created on


Setup

const now = Date.now();

const formatter = new Intl.DateTimeFormat(
    undefined,
    {
	    hour: 'numeric',
        minute: '2-digit'
    }
);

Test runner

Ready to run.

Testing in
TestOps/sec
toLocaleTimeString
const timeString = new Date(now).toLocaleTimeString(undefined, {
	hour: 'numeric',
	minute: '2-digit'
});
ready
Formatter
const timeString = formatter.format(new Date(now));
ready

Revisions

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