When you want to show these kind of stuff on a web page you must use javascript on the client. You can use setTimeout to mimic somekind of threading functionality. Each time you enter the given method, this is some sort of time slice for that thread (in a somewhat cooperative fashion).
Have a look here for an example:
"
http://www.sislands.com/coin70/week3/bball.htm[
^]
Good luck!