From owner-freebsd-hackers Fri Nov 8 13:55:04 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA11859 for hackers-outgoing; Fri, 8 Nov 1996 13:55:04 -0800 (PST) Received: from bacall.lodgenet.com (bacall.lodgenet.com [205.138.147.242]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id NAA11839 for ; Fri, 8 Nov 1996 13:54:57 -0800 (PST) Received: (from mail@localhost) by bacall.lodgenet.com (8.6.12/8.6.12) id PAA08910; Fri, 8 Nov 1996 15:54:02 -0600 Received: from garbo.lodgenet.com(204.124.123.250) by bacall via smap (V1.3) id sma008906; Fri Nov 8 15:54:01 1996 Received: from jake.lodgenet.com (jake.lodgenet.com [10.0.11.30]) by garbo.lodgenet.com (8.6.12/8.6.9) with ESMTP id PAA22713; Fri, 8 Nov 1996 15:54:13 -0600 Received: from jake.lodgenet.com (localhost [127.0.0.1]) by jake.lodgenet.com (8.7.6/8.6.12) with ESMTP id PAA00388; Fri, 8 Nov 1996 15:54:31 -0600 (CST) Message-Id: <199611082154.PAA00388@jake.lodgenet.com> X-Mailer: exmh version 1.6.9 8/22/96 To: amir@comtrol.com (Amir Farah) cc: hackers@freebsd.org Subject: Re: timeout() function In-reply-to: Your message of "Fri, 08 Nov 1996 09:41:05 CST." <199611081541.JAA00123@rocket.comtrol.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Nov 1996 15:54:31 -0600 From: "Eric L. Hernes" Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Amir Farah writes: >Hello > >I have a question about the timeout() function in /sys/kern/kern_clock.c file. > >You can execute a function after a specified length of time using >timeout(ftn, arg, ticks) > >ftn: function to be called >args: arguments for the function >ticks: delay > >If I pass "1" for the delay, does it mean the function will get called every >1 second?? I want to be able to call a funtion every 50 milisecond (or less). > ticks are 1/100 sec, so with a timeout of 1, your function will be called 100 times a second. If you want faster, you can hook into a clock interrupt, see the pcaudio driver for an example. Drivers that don't use interrupts can use these `callouts' for pseudo-interrupts. > >Thanks > >amir > > eric. -- erich@lodgenet.com http://rrnet.com/~erich erich@rrnet.com