Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Mac OS X 10.15
Desktop
one year ago
(Math.round(*10000)/10000).toString()
1580.5M/s
toFixed(4)
29.1M/s
toPrecision(4).toString()
26.2M/s
View exact numbers
Test name Executions per second
(Math.round(*10000)/10000).toString() 1,580,511,360 Ops/sec
toFixed(4) 29,054,398 Ops/sec
toPrecision(4).toString() 26,172,446 Ops/sec
Script Preparation code:
Tests: