]> git.lizzy.rs Git - plan9front.git/blob - sys/man/9/delay
audiohda: fix syntax error
[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. The minimum value of
19 .I ms
20 is one on most architectures.
21 .PP
22 .I Microdelay
23 works exactly the same as
24 .I delay
25 but using microseconds instead.
26 .PP
27 These routines are intended for use in interrupt contexts,
28 device reset and shutdown functions, and other places where
29 the scheduler is unavailable.
30 When you have a process context, and can sleep, consider
31 .IR tsleep (9).
32 .I Tsleep
33 does not busy wait.
34 .PP
35 .I Addclock0link
36 adds a new periodic timer to the current processor's timer list, with
37 .I clockf
38 executing every
39 .I ms
40 milliseconds. If
41 .I ms
42 is zero a default clock is used, it will panic otherwise (i.e.
43 .I ms
44 < 0).
45 .SH SOURCE
46 .B /sys/src/9/port/portclock.c
47 .br
48 .B /sys/src/9/*/clock.c
49 .SH SEE ALSO
50 .IR sleep (9)