Math Floor Alternatives

Benchmark published by System on

Description

Math.floor vs Bitwise OR.

Setup

const num = 1234.5678;

Test Runner

Initializing...

Testing in
Test CaseOps/sec
Math.floor
Math.floor(num);
ready
Bitwise OR (| 0)
num | 0;
ready
Double NOT (~~)
~~num;
ready
ParseInt
parseInt(num, 10);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

Revision 1
publishedby Systemon