How to do "Ticking Bomb" program?

I am creating a text based game, so I want to do one tiny system. How it would work: When you get Jailed you must wait X seconds.

So the screen would show you how much seconds left until you are set free like:

9996 seconds changes into 9995 seconds, and so on. Keep in mind this is console c++ game.
closed account (o3hC5Di1)
Hi there,

It depends on which platform you are using, but look into the sleep() function for the platform you are using (windows or unix/linux).

Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686298%28v=vs.85%29.aspx
Linux: http://linux.die.net/man/3/sleep

All the best,
NwN
Topic archived. No new replies allowed.