From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by ewsd; Sat Nov 16 07:52:35 EST 2019 X-Originating-IP: 185.198.110.254 Received: from coeus.antares-labs.eu (unknown [185.198.110.254]) (Authenticated sender: rgl@antares-labs.eu) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0CBABE0003 for <9front@9front.org>; Sat, 16 Nov 2019 12:52:28 +0000 (UTC) Message-ID: <30AFF1C5064196F4680421D88AE85224@antares-labs.eu> Date: Sat, 16 Nov 2019 13:52:25 +0100 From: rgl@antares-labs.eu To: /tmp/patch/sleep.9.patch@antares-labs.eu, 9front@9front.org Subject: Re: [9front] man: new section 9 In-Reply-To: 4EBBAA2AFB3EA490574FB941BCD5F0FE@antares-labs.eu MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-tgvfruxtrglwuogmndzfkddseu" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: generic enhancement SOAP module strategy This is a multi-part message in MIME format. --upas-tgvfruxtrglwuogmndzfkddseu Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit ok, another two pages. --upas-tgvfruxtrglwuogmndzfkddseu Content-Disposition: inline Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit diff -r 159c7e7ca171 sys/man/9/delay --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sys/man/9/delay Sat Nov 16 13:13:43 2019 +0100 @@ -0,0 +1,46 @@ +.TH DELAY 9 +.SH NAME +delay, microdelay, addclock0link \- small delays, clock interrupts +.SH SYNOPSIS +.ta \w'\fLTimer* 'u +.B +void delay(int ms) +.PP +.B +void microdelay(int µs) +.PP +.B +Timer* addclock0link(void(*clockf)(void), int ms) +.SH DESCRIPTION +.I Delay +busy waits for +.I ms +milliseconds, forced to be at least one millisecond on some architectures. +.PP +.I Microdelay +works exactly the same as +.I delay +but using microseconds instead. +.PP +For delays on the order of clock ticks, +.I tsleep +(see +.IR sleep (9)) +provides a better alternative to the busy waiting of these routines. +.PP +.I Addclock0link +adds a new periodic timer to the current processor's timer list, with +.I clockf +executing every +.I ms +milliseconds. If +.I ms +is zero a default clock is used, it will panic otherwise (i.e. +.I ms +< 0). +.SH SOURCE +.B /sys/src/9/port/portclock.c +.br +.B /sys/src/9/*/clock.c +.SH SEE ALSO +.IR sleep (9) --upas-tgvfruxtrglwuogmndzfkddseu--