Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Trunc vs Floor vs Number vs ParseInt vs ~~ using time
(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
Tests:
Trunc
Math.trunc((new Date()).getMinutes()/10.0);
Floor
Math.floor((new Date()).getMinutes()/10.0);
Number
Number((new Date()).getMinutes()/10.0);
ParseInt
parseInt((new Date()).getMinutes()/10.0);
Bitwise invert2
~~((new Date()).getMinutes()/10.0);
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:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser/OS:
Firefox 132 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Trunc
7019245.0 Ops/sec
Floor
7081973.0 Ops/sec
Number
6718807.5 Ops/sec
ParseInt
6824253.5 Ops/sec
Bitwise invert2
7092045.0 Ops/sec
Related benchmarks:
parseInt vs. substring
Trunc vs Floor vs ParseInt vs ~~
parseInt vs Math.trunc 2
parseInt-vs-math.floor
compate trunc vs parseInt
parseInt-vs-math.floor time
parseInt-vs-math.floor2agasdsgsa
round vs trunc vs floor vs parseInt
* 10, round vs trunc vs floor vs parseFloat vs ~~ vs 0 | vs parseInt vs parseInt, 10 loop
Comments
Confirm delete:
Do you really want to delete benchmark?