sleep(3C) Standard C Library Functions sleep(3C)NAME
sleep - suspend execution for an interval of time
SYNOPSIS
#include <unistd.h>
unsigned int sleep(unsigned int seconds);
DESCRIPTION
The caller is suspended from execution for the number of seconds specified by the argument. The actual suspension time may be less than
that requested because any caught signal will terminate the sleep() following execution of that signal's catching routine. The suspension
time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system. The value returned by
sleep() will be the ``unslept'' amount (the requested time minus the time actually slept) if the caller incurred premature arousal because
of a caught signal.
The use of the sleep() function has no effect on the action or blockage of any signal. In a multithreaded process, only the invoking thread
is suspended from execution.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
SEE ALSO nanosleep(3C), attributes(5), standards(5)SunOS 5.11 5 Feb 2008 sleep(3C)
Check Out this Related Man Page
usleep(3C)usleep(3C)NAME
usleep - suspend execution for interval in microseconds
SYNOPSIS
#include <unistd.h>
int usleep(useconds_t useconds);
The usleep() function suspends the caller from execution for the number of microseconds specified by the useconds argument. The actual sus-
pension time might be less than requested because any caught signal will terminate usleep() following execution of that signal's catching
routine. The suspension time might be longer than requested by an arbitrary amount because of the scheduling of other activity in the sys-
tem.
If the value of useconds is 0, then the call has no effect.
The use of the usleep() function has no effect on the action or blockage of any signal. In a multithreaded process, only the invoking
thread is suspended from execution.
On completion, usleep() returns 0. There are no error retruns.
No errors are returned.
USAGE
The usleep() function is included for its historical usage. The nanosleep(3RT) function is preferred over this function.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
nanosleep(3RT), sleep(3C), attributes(5), standards(5)
16 Mar 2005 usleep(3C)
Hi everyone,
Is there a variable or built in function in the Unix env. for me to obtain the name of a signal that is caught? As far as I understand only a numeric value of the signal is returned to the handler.
For example:
void handler (int signum)
{
... (2 Replies)
Hello,
I am new to this forum and relatively new to unix, but hope to become an expert soon!
My question is: How can I find out the execution time of a command that has already completed execution? More specifically, I launched a Python script to populate a PostgreSQL database on Suse... (2 Replies)
Hi
I have a lot of scripts running on a Sun Solaris server, which are constantly running in a loop looking for work to do. When they have no work they sleep for a certain amount of time (60secs normally). I have 13 of these scripts running the number of sleep command issued can be in the order... (4 Replies)
Hi
I've stumbled over something that caught my attention but I'm not familiar enough with IPs to know if this is suspect or irrelevant. If you'd take the time to read and respond I'd greatly appreciate it. I'm just stumped.
I've done a site for some people (4 in the group) awhile ago and set... (4 Replies)
I make two process killing and calling one process
I want to do this repeatedly many time between the interval(sleep)
What will be the command to do this, can you make as one
do use sleep between and run clear the memory(sh sync.sh)
I need your advice,
the script will be like this
killps... (1 Reply)
unistd.h declares the prototype of the sleep function. where is the sleep function actually defined? where is the control transfered when we include a sleep call in it?? (2 Replies)
Hi all,
do ny o u'll know how to set a particular execution time for a program???
for eg.:
--> during the execution of a file, i call a certain other function.
--> while calling this function, my comp hangs.
now is there ny way in which i can go to the nxt line of code by aborting the call... (7 Replies)
This is a very crude attempt in Bash at something that I needed but didn't seem to find in the 'sleep' command. However, I would like to be able to do it without the need for the temp file. Please go easy on me if this is already possible in some other way:
How many times have you used the... (5 Replies)
Hi Forum.
I have a script that accepts 3 input parameters (source directory, list file text, sleep time) and checks for the presence of files. If not there, script goes to sleep for certain amount of time provided by 3rd input.
list file text contains 1 entry but may contain more (file... (13 Replies)
Hi Forum
Im using sleep in a while loop goes around 10 times. i feed it a variable with the time i what it to sleep for eg sleep $sleepVal and then print system date and time to screen but sometimes 1 second is added to the time why is this
here my code
sleepVal=5
while
do
... (3 Replies)
Hi,
can we print anything, when sleep is running..?
like printing dots(.. . . . . . . . .) to indicate that some process is going on...?
i mean, can we send sleep to background, proceed with printing, till sleep is going on... in s single step.
I have written a funtion to solve this.
... (1 Reply)
I am scheduling a task at regular intervals at seconds acuracy using crond and sleep command . my data in crontab file is as below:-
the above line is working fine when we are creating this crontab file before 00:05 min .
But when we are creating the crontab file at 00:05min , unable to... (10 Replies)