Time pause during loop

ctmckee
Posts: 20
Joined: 2012-02-16
Location: United States

Is it possible to put a time pause in a loop, e.g. wait 10 seconds between each iteration of the loop.


andyfaff
Posts: 476
Joined: 2007-09-11
Location: Australia

Excellent, reminds me of this article:
http://thedailywtf.com/Articles/The-Speedup-Loop.aspx

sleep/s 10


daggaz
Posts: 98
Joined: 2012-04-18
Location: Denmark

new user here, but i'd hazzard a guess that ticks, startMSTimer and stopMSTimer are the functions you would want to look at. tossing zeros into a loop would have variable results on different systems, after all.. ;)


andyfaff
Posts: 476
Joined: 2007-09-11
Location: Australia

daggaz wrote:
new user here, but i'd hazzard a guess that ticks, startMSTimer and stopMSTimer are the functions you would want to look at. tossing zeros into a loop would have variable results on different systems, after all.. ;)

Sleep is the operation you want. I was making a joke about tossing extra loop iterations in somewhere :-).


Posts: 836
Joined: 2007-06-29
Location: United States

daggaz wrote:
new user here, but i'd hazzard a guess that ticks, startMSTimer and stopMSTimer are the functions you would want to look at. tossing zeros into a loop would have variable results on different systems, after all.. ;)

Andy's right- use Sleep. These functions are more for measuring elapsed time, not for pausing execution.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


Back to top