Script Preparation code:
AخA
 
var a = 1234;
var b = 77
Tests:
  • Math.round

     
    Math.round(a/b * 10)/10
  • ToFixed()

     
    (a/b).toFixed(1)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Math.round
    ToFixed()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; CrOS x86_64 14092.77.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.107 Safari/537.36
Chrome 93 on Chrome OS 14092.77.0
View result in a separate tab
Test name Executions per second
Math.round 794158.1 Ops/sec
ToFixed() 765313.6 Ops/sec