Sleep in Cocoa?

I don’t know why, but the statistics of this blog says that there are lots lof people who have interest in sleep function in Cocoa. Probably a same guy keeps visiting my blog for this.

Well, I don’t know what is so special about sleep.

Mac OS X is UNIX. So, you can use any standard library functions like sleep(), usleep() and nanosleep(). Also, NSThread provides Cocoa-level sleep facility.

One Response to this post.

  1. iPhone sleep usleep sleepForTimeInterval NSTimer…

    3 Möglichkeiten eine iPhone Anwendung zu pausieren:
    [NSThread sleepForTimeInterval:5];
    sleep(5);
    usleep(5000000);
    Alle 3 Anweisungen bewirken das gleiche Ergebniss, die Anwenudng wird schlafen gelegt. nachteil aller Optionen: die Anwendung wird wirklic…

    Reply

Respond to this post