LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   looking for a Sleep() function (https://www.linuxquestions.org/questions/linux-software-2/looking-for-a-sleep-function-247045/)

Mike Davies 10-25-2004 07:29 AM

looking for a Sleep() function
 
I'm looking for a function that will suspend the current thread for several mSec. In Windows this would be Sleep().

What does Linux offer ? I've found udelay() and mdelay() but it involves dragging in include files that then cause other problems.

ANy help appreciated.

Mike

khtse 10-25-2004 07:36 AM

man usleep:

NAME
usleep - suspend execution for microsecond intervals

SYNOPSIS
/* BSD version */
#include <unistd.h>

void usleep(unsigned long usec);

DESCRIPTION
The usleep() function suspends execution of the calling
process for (at least) usec microseconds. The sleep may
be lengthened slightly by any system activity or by the
time spent processing the call or by the granularity of
system timers.

Mike Davies 10-25-2004 08:11 AM

Excellent !

Many thanks.


All times are GMT -5. The time now is 06:51 AM.