Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-25-2004, 08:29 AM   #1
Mike Davies
Registered: Jul 2004
Distribution: Custom Linux 4/Busybox. Fedora 22, Raspberry Pi
Posts: 98

Rep: Reputation: 15
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.

Old 10-25-2004, 08:36 AM   #2
Registered: Sep 2003
Location: Hong Kong
Distribution: Slackware 9.1
Posts: 43

Rep: Reputation: 15
man usleep:

usleep - suspend execution for microsecond intervals

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

void usleep(unsigned long usec);

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.
Old 10-25-2004, 09:11 AM   #3
Mike Davies
Registered: Jul 2004
Distribution: Custom Linux 4/Busybox. Fedora 22, Raspberry Pi
Posts: 98

Original Poster
Rep: Reputation: 15
Excellent !

Many thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for Server (BOOTP/DHCP) <sleep> <sleep> .. .. Eileen Linux - Networking 12 10-21-2005 02:14 AM
How to disable the Monitor Sleep function under RH9 ?? 242VDM242 Linux - Newbie 1 05-21-2005 02:51 PM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 02:31 PM
Is the wait function is the same as the sleep function ? Linh Programming 3 04-28-2004 01:39 PM
help using rtc as a more accurate replacement for python's 'sleep' function kernelpanicguy Programming 0 11-29-2003 01:36 AM > Forums > Linux Forums > Linux - Software

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration