Created
July 19, 2013 22:42
-
-
Save gmilby/6042890 to your computer and use it in GitHub Desktop.
performance test on while 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.25400330 seconds | |
$i = 0 ; | |
while($i<1000000){ $i++ ; } | |
Syntax B - 0.25518957 seconds | |
$i = 0 ; | |
while($i<=999999){ $i++ ; } | |
Syntax C - 0.26488042 seconds | |
$i = 0 ; | |
while($i!=1000000){ $i++ ; } | |
Syntax D - 0.25089923 seconds | |
$i = 1000000 ; | |
while($i>0 ){ $i-- ; } | |
Syntax E - 0.25067065 seconds | |
$i = 1000000 ; | |
while($i>=1 ){ $i-- ; } | |
Syntax F - 0.25501704 seconds | |
$i = 1000000 ; | |
while($i!=0 ){ $i-- ; } | |
Syntax G - 0.16932660 seconds | |
$i = 1000000 ; | |
while($i){ $i-- ; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment