Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0) Gecko/20100101 Firefox/78.0
Firefox 78
Mac OS X 10.11
Desktop
2 years ago
(Math.round(*10000)/10000).toString()
12.6M/s
toFixed(4)
4.9M/s
toPrecision(4).toString()
4.5M/s
View exact numbers
Test name Executions per second
(Math.round(*10000)/10000).toString() 12,607,098 Ops/sec
toFixed(4) 4,919,254 Ops/sec
toPrecision(4).toString() 4,466,932 Ops/sec
Script Preparation code:
Tests: