The count() function is called immediately after the HTML page was loaded as a handler of the onload event of the body element. The count() function increments the counter and schedules a new call to the same function to occur after 1 second if the counter did not reach the value 5 yet.

Counter value:
0
  of   5