That's not how MAME works. The while loop would prevent time from advancing. What are you actually trying to do?