Created
July 19, 2013 22:40
-
-
Save gmilby/6042881 to your computer and use it in GitHub Desktop.
speed tests for "for loops"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Syntax A - 0.25367754 seconds | |
for($i=0; $i<1000000; $i++){} | |
Syntax B - 0.25415988 seconds | |
for($i=0; $i<=999999; $i++){} | |
Syntax C - 0.25957097 seconds | |
for($i=0; $i!=1000000; $i++){} | |
Syntax D - 0.25594527 seconds | |
for($i=1000000; $i>0; $i--){} | |
Syntax E - 0.25266805 seconds | |
for($i=1000000; $i>=1; $i--){} | |
Syntax F - 0.25876847 seconds | |
for($i=1000000; $i!=0; $i--){} | |
Syntax G - 0.17032199 seconds | |
for($i=1000000; $i; $i--){} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment