i don't really understand the difference between these 3 functions... assuming i have a program running, with several timers going on in the background for different things, and i execute an IBAction which would execute some stuff and then pause for 2 seconds before redirecting to another method in the class... which of these 3 functions are better to use and why?
i should probably mention that while "usleep" seems to be an actual function and compiles without error: usleep(<#useconds_t #>), it doesn't work for me at all...
Code:
-(IBAction)start:(id)sender
{
[COLOR="Green"]//do something;
//do something else;[/COLOR]
[NSThread sleepForTimeInterval:2]; [COLOR="green"]//or[/COLOR]
sleep(2); [COLOR="green"]//or[/COLOR]
usleep(2000);
[COLOR="green"]//then redirect to another method within the class[/COLOR]
}
i should probably mention that while "usleep" seems to be an actual function and compiles without error: usleep(<#useconds_t #>), it doesn't work for me at all...