Convert to number

Benchmark created on


Description

The fastest way to convert string to number

Setup

str = String(Math.random()*10000000000000).split('.')[0]

Test runner

Ready to run.

Testing in
TestOps/sec
+
num = +str
ready
Number
num = Number(str)
ready
parseInt
num = parseInt(str)
ready
right shift
num = str >> 0
ready

Revisions

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