I need a way to sleep in javascript. Yes, I know about setTimeout
and so on, but those won't do for me. I need a real sleep. One that freezes the tab or the browser. But preferably without spinning the CPU. Yes, I really, really need that. I'm sure, and I really know what I'm doing.
Of course, from a webpage that was loaded over HTTP, I could just do a synchronous GET request to /cgi-bin/sleep.sh?5000
or so (precision doesn't matter for me). However, I'm in a data URI context, so I need something more generic. I could embed a java applet and call its Thread.sleep from Javascript, I think, but I don't want to require Java. And flash doesn't seem to be able to do blocking HTTP requests.
So, does anyone know a way to sleep in a data uri context just using javascript and flash? Chromium-specific answers are ok.
I guess my reputation will go down after asking this...