views:

68

answers:

1

Is there an easy way to make some "sleeping program" functionality by just calling function, such as it has been made in Java with Thread.sleep()?

Sleep method causes, in brief, app to wait indicated time (no. of milisec.) and after that time returns to next line of code (so it "blocks" - it isn't not proper word, though - the current thread).

Thanx in advance.

+3  A: 

Use the Sleep function.

nos
Thanx for help, but keyboard and/or touch must be still handled while app's main loop is in "sleep mode". I can't find the way that standard sleep() could make it done...
forsberg
You're right, you can't do that. You'd have to run your business in another thread, so sleeping doesn't block the UI.
nos
The app's main loop is what handles keyboard/touch, so you can't have it sleep and process those events. If you have processes happening that need to sleep, put them on a thread.
ctacke