focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / sleep
1 NAME
2     sleep - suspend operation for a specified time
3
4 SYNOPSIS
5     sleep([n])
6
7 TYPES
8     n           non-negative real, defaults to 1
9
10     return      integer or null value
11
12 DESCRIPTION
13     This uses the C-library sleep (if n is integral) or usleep (for
14     non-integral n) to suspend operation for n seconds.  If n is an
15     integer and the sleep is stopped by an interruption, the number
16     of seconds remaining is returned.
17
18     One kind of use is to slow down output to permit easier reading of
19     results, as in:
20
21         > for (i = 0; i < 100; i++) {
22                 print sqrt(i);
23                 sleep(1/2);
24         }
25
26     The following illustrates what happens if ctrl-C is hit 5 seconds
27     after the first command:
28
29         > print sleep(20)
30
31         [Abort level 1]
32         15
33         >
34
35 EXAMPLE
36     > sleep(1/3);
37     > sleep(20);
38
39 LIBRARY
40     none
41
42 SEE ALSO
43     none
44