I'm not sure this would work in a browser, but it might, put a \r before your status print statement. This is the "carrige return" character which should just return you to the beginning of the line. \n does a "carrige return" to go back to the beginning of the line as well as a "line feed" to go to the next line (at least in Windoze systems).
This is a trick used in console applications to simulate a continuously updating "status line" without all the fancy schmancy GUI stuff.
Comment on Re: show a message only during the sleep time
It (just printing \r) won't work in the context of a browser .. It can, as the poster states, work in the context of a console application, but note that something from curses or console or term will probably be better/more robust (again, just for console apps -- not your browser-context issue).