It occurs to me that, while you can set the "sleep" to anything you like down to 1 second (but you can't set it smaller), you might have two or more web-page accesses during the sleep period; and you wanted to do the append for every access.
Much easier to do a "tail -f" on the Web server's log file, read lines in a loop and do whatever we want to do for each line.