Yes, I've used a similar technique myself; however I consider it only a last resort. But doesn't that require your language to have threads? Is it possible to do this in eg. Javascript?
Edit: although you could emulate a sleep call by setting a (pediodic) timeout