Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sleep(3c) [opensolaris man page]

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

sleep(3C)																 sleep(3C)

NAME
sleep - suspend execution for an interval of time SYNOPSIS
#include <unistd.h> unsigned int sleep(unsigned int seconds); 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. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ nanosleep(3RT), attributes(5), standards(5) 16 Mar 2005 sleep(3C)
Man Page

14 More Discussions You Might Find Interesting

1. Programming

Signal Names

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

2. UNIX for Dummies Questions & Answers

Retrieving the execution time of a completed command

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

3. 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

4. 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

5. 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

6. 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

7. UNIX for Dummies Questions & Answers

sleep command

If I give sleep(50) what does it mean? My program waits for further execution or all my other processes wait? (3 Replies)
Discussion started by: leewar
3 Replies

8. UNIX for Advanced & Expert Users

sleep working

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

9. 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

10. Shell Programming and Scripting

Wrapping 'sleep' with my 'resleep' function (Resettable sleep)

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

11. 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

12. 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

13. Shell Programming and Scripting

Need help regarding sending sleep to background

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

14. 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