of course the code outside the PHP tags will not be executed by PHP compiler, but directly to the web browser.
But the difference is in milli seconds i guess, so it doesnt really make any difference, unless you have a page with 1000's of lines of HTML code generation, then it might make a difference of second or 2.
the time of loops, whether its FOR, IF, WHILE, SWITCH etc, really depends on the complexity of the loop you have. this issure is quite complex and we have systems like Big O notation etc. to find out the time of the code's running. But then again they vary from milliseconds or so.
if you say:
$num = 5;
for ($i=0; $i<$num; $i++) {
...
}
OR
while ($i<$num) {
...
$i++
}
etc.. would not make any difference at all, because the number of loop is so low that you wont notice any difference.