Increment (v5)

Revision 5 of this benchmark created by Spoiler on


Description

Tries out various methods of incrementing a variable.

Preparation HTML

<script>
  var x1 = 0;
  var x2 = 0;
  var x3 = 0;
  var x4 = 0;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
post-increment
x1++;
ready
pre-increment
++x2;
ready
+ 1
x3 = x3 + 1
ready
+=
x4 += 1;
ready

Revisions

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