User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:sleep [2019/11/11 05:00]
cl:functions:sleep [2019/11/11 22:00] (current)
Line 1: Line 1:
 +====== Function SLEEP ======
 +
 +====Syntax====
 +  * **sleep** //seconds// → //​**[[CL:​Constant Variables:​nil]]**//​
 +
 +====Arguments and Values====
 +  * //seconds// - a non-negative //​[[CL:​Glossary:​real]]//​.
 +
 +====Description====
 +Causes execution to cease and become dormant for approximately the seconds of real time indicated by //​seconds//,​ whereupon execution is resumed.
 +
 +====Examples====
 +<​blockquote>​
 +(sleep 1) <​r>​NIL</​r>​
 +
 +;;; Actually, since SLEEP is permitted to use approximate timing, this might not always
 +;;; yield true, but it will often enough that we felt it to be a productive example of the intent.
 +([[CL:​Special Operators:​let]] ((then ([[CL:​Functions:​get-universal-time]]))
 +      (now ([[CL:​Special Operators:​progn]] (sleep 10) ([[CL:​Functions:​get-universal-time]]))))
 +  ([[CL:​Functions:​math-not-less|>​=]] ([[CL:​Functions:​math-subtract|-]] now then) 10)) 
 +<​r>//​[[CL:​Glossary:​true]]//</​r>​
 +</​blockquote>​
 +
 +====Side Effects====
 +Causes processing to pause.
 +
 +====Affected By====
 +The granularity of the scheduler.
 +
 +====Exceptional Situations====
 +Should signal an error of type type-error if //seconds// is not a non-negative //​[[CL:​Glossary:​real]]//​.
 +
 +====See Also====
 +None.
 +
 +====Notes====
 +None.
 +