Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Mobile/15E148 Safari/604.1
Mobile Safari 18
iOS 18.3.1
Mobile
one year ago
Math.round(n)
535.6M/s
Bitwise n + (n < 0 ? -0.5 : 0.5)>>0
489.9M/s
View exact numbers
Test name Executions per second
Math.round(n) 535,646,272 Ops/sec
Bitwise n + (n < 0 ? -0.5 : 0.5)>>0 489,942,784 Ops/sec
Script Preparation code:
Tests: