The "standard" and to some degree portable way of doing subsecond
waiting is creative misuse of select(3?). This is described in the
manpage for select. This method offer waiting with a granularity of 10
ms. There may be some slack in the precise delay achieved, depending on
system loading and task priority.

If daring to setuid root the program, it may ask for real time
scheduling (remember to give up root priorities afterwards), see the
manpage for sched_set (or something, see what manpages starts with
sched_).

If a finer granularity is necessary, this can be achieved
_on_an_unloaded_system_ (which is the same as saying that it can not
really be guaranteed) by combining the above scheduler settings with
programming /dev/rtc, which is an interface to the interrupt-generating
facilities in the CMOS real time clock. Somewhere deep inside /usr/doc
(I think) I once found a really good description of this, I think by the
author of /dev/rtc. Or maybe it came together with a kernel source. In
any case, the kernel source for /dev/rtc is well commented and good
reading.

Hopes this to be of some help,

Niels HP,
[EMAIL PROTECTED]

> ----------
> From:         SookYoung Kim[SMTP:[EMAIL PROTECTED]]
> Reply To:     SookYoung Kim
> Sent:         29. september 1998 07:05
> To:   [EMAIL PROTECTED]
> Subject:      Waiting for 125msecs.
> 
> Hi, all
> I  need a function that waits for 125 msecs.
>  As long as i know, sleep() function is only available for seconds.
>  Is it right? If it is, I need to find another function or other
> things.
> Is there any function that wait for any msecs in LINUX?
> Please help me.
> If it's a stupid question, I'm sorry for that..
> --
> Sook Young Kim
> E-mail: [EMAIL PROTECTED]
>         [EMAIL PROTECTED]
> 
Samsung monitors are cool !!

Reply via email to