posted 20 years ago
Using loops to implement time delays went out with BASIC. It is a bad idea because the amount of time delay may vary hugely depending on processor power, loading and also on the extent to which compiler and/or hotspot are able to optimise-away redundant code like an empty loop.
Use Thread.sleep() or Thread.wait(). The former does not require you to hold the lock on "this" and indeed you generally should not hold any locks when doing sleep(). The latter does require you to hold the lock on "this", but releases it while wait()ing, then regains it when finished waiting.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.