String to Integer conversion. (v14)

Revision 14 of this benchmark created on


Description

Test the fastest way to convert a string to an integer, or a float to an integer.

Setup

var f = Math.random() * 1000;
    var s = '14.5';

Test runner

Ready to run.

Testing in
TestOps/sec
parseInt
parseInt(f);
parseInt(s);
ready
bitwise
~~f;
~~s;
ready

Revisions

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