Delay for a fraction of a second in C

Mark H. Colburn colburn at src.honeywell.COM
Sat Nov 5 03:37:10 AEST 1988


In article <2804 at ingr.UUCP> crossgl at ingr.UUCP (Gordon Cross) writes:
>In article <1145 at orion.cf.uci.edu>, echarne at orion.cf.uci.edu (Eli B. Charne) writes:
#> The Unix sleep command will only go in increments of one second.  I was
#> wondering if someone new of a nice little routine I could use, or has
#> written one that will let me pause (in the Unix operating system) for
#> a fraction of a second.
#> be great!
#You are not going to be able to do this without coding up some kind of
#"delay loop" yourself.

Actually, under System V you can use the VMIN timer on the tty driver,
which will give you granularity of about 1/10 of a second.  As long as your
are going to be doing terminal oriented work, this is fairly easy.  This
does not work on most BSD systems, although there you have higher
granularity sleeps anyways...



More information about the Comp.lang.c mailing list