enterframe event and application:frameCount() or a difference between two os.timer values - I think that also Timer.delayedCall is a good option if you're not afraid of timers
The safest way of doing this is using one central onEnterFrame event that all classes subscribe to. You can then remove this one listener to pause everything in the game, then add it back to resume.
In my case I usually have a GameLoop class that other classes listen to:
I use Timer.pauseAll() for timers and GTween.pauseAll = true for tweens in my pause menu (as well as using a central onEnterFrame event like @totebo suggested.) Both of these, however, gave me some headaches and took a bit of rewriting and reorganizing of my code. Figuring out when to pause and resume these so they don't affect other things in the code can be tricky, but they are still useful in certain cases.
You could make such function, but it is not suggested, as it halts all interface, usually you need to pause only some portion of your game, like box2d physics, etc, which can be achieved through mentioned methods.
Comments
Likes: misterhup
In my case I usually have a GameLoop class that other classes listen to:
Likes: misterhup
Likes: misterhup
But if you want the busy wait method, you could try this:
http://lua-users.org/wiki/SleepFunction
Likes: misterhup