Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sleep(3c) [hpux man page]

sleep(3C)																 sleep(3C)

NAME
sleep() - suspend execution for interval SYNOPSIS
DESCRIPTION
suspends the current process from execution for the number of seconds specified by the argument. Actual suspension time can be less than that requested for two reasons: o Scheduled wakeups occur at fixed 1 second intervals (on the second, according to an internal clock), and o Any caught signal terminates the sleep following execution of that signal's catching routine. Suspension time can be an arbitrary amount longer than requested due to the scheduling of other activity in the system. The value returned by is the "unslept" amount (the requested time minus the time actually slept) in case the caller had an alarm set to go off earlier than the end of the requested time, or premature arousal due to another caught signal. seconds must be less than 2^31. APPLICATION USAGE
If a is generated for a multithreaded process, it may not be delivered to a thread currently in See the sigwait(2) manpage for details. SEE ALSO
sigwait(2), signal(5), thread_safety(5). STANDARDS CONFORMANCE
sleep(3C)

Check Out this Related Man Page

sleep(3UCB)					     SunOS/BSD Compatibility Library Functions					       sleep(3UCB)

NAME
sleep - suspend execution for interval SYNOPSIS
/usr/ucb/cc [ flag ... ] file ... int sleep( seconds); unsigned seconds; DESCRIPTION
sleep() suspends the current process from execution for the number of seconds specified by the argument. The actual suspension time may be up to 1 second less than that requested, because scheduled wakeups occur at fixed 1-second intervals, and may be an arbitrary amount longer because of other activity in the system. sleep() is implemented by setting an interval timer and pausing until it expires. The previous state of this timer is saved and restored. If the sleep time exceeds the time to the expiration of the previous value of the timer, the process sleeps only until the timer would have expired, and the signal which occurs with the expiration of the timer is sent one second later. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
alarm(2), getitimer(2), longjmp(3C), siglongjmp(3C), sleep(3C), usleep(3C), attributes(5) NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-thread applications is unsupported. SIGALRM should not be blocked or ignored during a call to sleep(). Only a prior call to alarm(2) should generate SIGALRM for the calling process during a call to sleep(). A signal-catching function should not interrupt a call to sleep() to call siglongjmp(3C) or longjmp(3C) to restore an environment saved prior to the sleep() call. WARNINGS
sleep() is slightly incompatible with alarm(2). Programs that do not execute for at least one second of clock time between successive calls to sleep() indefinitely delay the alarm signal. Use sleep(3C). Each sleep(3C) call postpones the alarm signal that would have been sent during the requested sleep period to occur one second later. SunOS 5.10 12 Feb 1993 sleep(3UCB)
Man Page

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

High kernel usage using sleep

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)
Discussion started by: handak9
4 Replies

2. UNIX for Dummies Questions & Answers

last execution time

is there a command in Solaris 8 that will show a particular scripts last execution time? (1 Reply)
Discussion started by: cubs0729
1 Replies

3. IP Networking

IP# Strangeness Please Help

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)
Discussion started by: jolene
4 Replies

4. Shell Programming and Scripting

loop of killing and calling process

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)
Discussion started by: 197oo302
1 Replies

5. UNIX for Advanced & Expert Users

specifying an execution time

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)
Discussion started by: VGR
7 Replies

6. Shell Programming and Scripting

script to check for existence of file (or else sleep for x time)

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)
Discussion started by: pchang
13 Replies

7. UNIX for Dummies Questions & Answers

sleep command off by a second

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)
Discussion started by: ShinTec
3 Replies

8. Shell Programming and Scripting

problem with sleep cmd in execution of cron...

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)
Discussion started by: manoj424
10 Replies

9. UNIX for Advanced & Expert Users

Kill a process after a certain amount of time

I would like to kill a process after a certain amount of time. Can I please get some ideas on how to do this? (9 Replies)
Discussion started by: cokedude
9 Replies