Path: utzoo!utgpu!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!soup.ssl.berkeley.edu!gckaplan From: gckaplan@soup.ssl.berkeley.edu (George Kaplan) Newsgroups: comp.lang.c Subject: Re: Delay for a fraction of a second in C Message-ID: <16459@agate.BERKELEY.EDU> Date: 3 Nov 88 17:02:47 GMT References: <1145@orion.cf.uci.edu> <2804@ingr.UUCP> Sender: usenet@agate.BERKELEY.EDU Organization: University of California, Berkeley Lines: 19 In article <1145@orion.cf.uci.edu>, echarne@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. If it could go to 100th of a second, that would > be great! On a Sun (and presumably under bsd 4.x as well) there's a usleep() function to sleep for a specified number of microseconds: void usleep(useconds) unsigned useconds; This actually pauses for _at least_ the specified number of useconds. The actual delay may be longer depending on other activity in the system. - George C. Kaplan gkaplan@sag4.ssl.berkeley.edu