Integer Conversion
JavaScript performance comparison
Info
Compares different methods of integer conversion
Preparation code
<script>
function toInt(v) {
if (v < 0) return Math.ceil(v);
else return Math.floor(v);
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
parseInt |
|
pending… |
Primitive Data Type |
|
pending… |
Math functions |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Jon Raasch
- Revision 2: published
- Revision 6: published by Johan Nordberg
- Revision 7: published by Johan Nordberg
0 comments