Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Trunc vs Floor vs Number vs ParseInt vs ~~
(version: 1)
Trunc vs Floor vs Number vs ParseInt vs ~~
Comparing performance of:
Trunc vs Floor vs Number vs ParseInt vs Bitwise invert2
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var num = Math.random() * 100;
Tests:
Trunc
Math.trunc(num);
Floor
Math.floor(num);
Number
Number(num);
ParseInt
parseInt(num);
Bitwise invert2
~~(num);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
Trunc
Floor
Number
ParseInt
Bitwise invert2
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?