You can get the same output with for and while loops:
While:
$i = 0;
while ($i <= 10){
print $i.\"\\n\";
$i++;
};
Set the loop iterations to 10,000.
Find the time in milliseconds>Run Loop>find time in milliseconds and subtract the first timer.
Do it for both codes, what ever one has the lowest milliseconds it runs faster. You might want to run the test multiple times and average them out to reduce the likelihood of background processes influencing the test.
You are likely to get really similar times on both of them, but I am interested to see if one is always just slightly faster.