Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
padStart vs splice vs conditional
Measures speed between using padStart and splice and conditional
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 134
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
splice
73.5M/s
condition
68.6M/s
padStart
27.1M/s
View exact numbers
Test name
Executions per second
✓
splice
73,546,632 Ops/sec
condition
68,643,776 Ops/sec
padStart
27,122,760 Ops/sec
Tests:
padStart
let x = 5; let res = ("" + x).padStart(2, "0")
splice
let x = 5; let res = ("0" + x).slice(-2)
condition
let x = 5; let res = x<10 ? `0${x}` : `${x}`