]> git.lizzy.rs Git - plan9front.git/blob - sys/man/9/delay
merge
[plan9front.git] / sys / man / 9 / delay
1 .TH DELAY 9
2 .SH NAME
3 delay, microdelay, addclock0link \- small delays, clock interrupts
4 .SH SYNOPSIS
5 .ta \w'\fLTimer* 'u
6 .B
7 void    delay(int ms)
8 .PP
9 .B
10 void    microdelay(int µs)
11 .PP
12 .B
13 Timer*  addclock0link(void(*clockf)(void), int ms)
14 .SH DESCRIPTION
15 .I Delay
16 busy waits for
17 .I ms
18 milliseconds, forced to be at least one millisecond on some architectures.
19 .PP
20 .I Microdelay
21 works exactly the same as
22 .I delay
23 but using microseconds instead.
24 .PP
25 For delays on the order of clock ticks,
26 .I tsleep
27 (see
28 .IR sleep (9))
29 provides a better alternative to the busy waiting of these routines.
30 .PP
31 .I Addclock0link
32 adds a new periodic timer to the current processor's timer list, with
33 .I clockf
34 executing every
35 .I ms
36 milliseconds. If
37 .I ms
38 is zero a default clock is used, it will panic otherwise (i.e.
39 .I ms
40 < 0).
41 .SH SOURCE
42 .B /sys/src/9/port/portclock.c
43 .br
44 .B /sys/src/9/*/clock.c
45 .SH SEE ALSO
46 .IR sleep (9)