Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
parseInt vs Math.trunc
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Browser:
Firefox 139
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
parseInt
1619.4M/s
Trunc
1454.7M/s
View exact numbers
Test name
Executions per second
✓
parseInt
1,619,430,784 Ops/sec
Trunc
1,454,671,232 Ops/sec
Script Preparation code:
var num = Math.random() * 100;
Tests:
Trunc
Math.trunc(num);
parseInt
parseInt(num);