If you are expecting the output to display in near real-time, line by line, it won’t. Web servers and browsers don’t interact like this. They work on a request, response basis. The browser makes a http request for a web page. The web server produces the page and outputs it back to the browser. Due to the buffering that takes place on the web server, in the communications, and in the browser, by the time you see the first character displayed in the browser, the web server has likely long since finished serving the request.
You also have a time scale issue. The time it is taking for this list of tasks to complete, is less than one second. You would need to display the Milliseconds and/or Microseconds, which requires using a datetime object, for you see any more than the unit seconds change by one.
What is your overall goal for doing this at all? If this is for debugging, it would be better if you used microtime(), and then calculated and displayed the time difference for each section of code.
Also, please use bbcode code tags [code][/code]
or markdown (three back-ticks ```) around your code when posting it. I have added these to the last two pieces of code.