📄 sleep.3
字号:
.\" SCCSID: @(#)sleep.3 2.2 8/10/87.TH sleep 3 .SH Namesleep \- suspend execution for interval.SH Syntax.nf.B unsigned.B sleep(seconds).B unsigned seconds;.fi.SH Description.NXR "sleep subroutine (standard C)".NXR "process" "suspending"The current process is suspended from execution for the numberof seconds specified by the argument.The actual suspension time may be up to 1 second less thanthat requested, because scheduled wakeups occur at fixed 1-second intervals,and an arbitrary amount longer because of other activityin the system..PPThe routine is implemented by setting an interval timerand pausing until it occurs.The previous state of this timer is saved and restored.If the sleep time exceeds the time to the expiration of theprevious timer,the process sleeps only until the signal would have occurred, and thesignal is sent 1 second later..SH Return ValuesThe value returned by .PN sleepis the unslept amount(the requested time minus the time actually slept). Thisreturn value may be non-zero in cases where the caller had an alarm set to gooff earlier than the end of the requested time, or where .PN sleepwas interrupted due to a caught signal(see ENVIRONMENT below)..SH Environment.PPPOSIX.brSYSTEM_FIVE.brWhen your program is compiled in POSIX or System V mode, the .PN sleepwill be terminated by any caught signal. The .PN sleepfunction will return following execution of the signal's catching routine..SH See Alsosetitimer(2), sigpause(2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -