Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133
Mac OS X 10.15.7
Desktop
one year ago
(Math.round(*10000)/10000).toString()
120.8M/s
toPrecision(4).toString()
33.5M/s
toFixed(4)
27.4M/s
View exact numbers
Test name Executions per second
(Math.round(*10000)/10000).toString() 120,808,664 Ops/sec
toPrecision(4).toString() 33,531,930 Ops/sec
toFixed(4) 27,431,462 Ops/sec
Script Preparation code:
Tests: