# Programming Cocoa to pause between actions



## zootbobbalu (Nov 16, 2001)

How can you program Cocoa to pause between actions? I wan't to make something move across the screen slow, but I don't know how to make Cocoa pause between redraws.

Any ideas?


----------



## DrBozze (Nov 20, 2001)

How about <code>NSThread sleepUntilDate:</code> in Foundation? That would probably be a good place to start.


----------



## blb (Nov 20, 2001)

There are also two Unix-level calls you can use:  sleep (sleep for a number of seconds) and usleep (sleep for a number of microseconds); do a *man 3 sleep* or *man usleep* for info.


----------



## DrBozze (Nov 20, 2001)

Timers. Don't forget about timers. Check out <code>NSTimer</code> for info on using timers in Cocoa.


----------

