toLocaleTimeString

Benchmark created on


Setup


Test runner

Ready to run.

Testing in
TestOps/sec
A
(new Date() ).toLocaleTimeString( [], { hour12: false } )
ready
B
var x = new Date();
x.getHours().toString().padStart(2, '0') + ':' + x.getMinutes().toString().padStart(2, '0') + ':' + x.getSeconds().toString().padStart(2, '0')
ready

Revisions

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