Home | History | Annotate | Line # | Download | only in larn
nap.c revision 1.5
      1  1.5  christos /*	$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $	*/
      2  1.5  christos 
      3  1.5  christos /* nap.c		 Larn is copyrighted 1986 by Noah Morgan. */
      4  1.5  christos #include <sys/cdefs.h>
      5  1.2   mycroft #ifndef lint
      6  1.5  christos __RCSID("$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $");
      7  1.5  christos #endif				/* not lint */
      8  1.2   mycroft 
      9  1.5  christos #include <unistd.h>
     10  1.5  christos #include "header.h"
     11  1.5  christos #include "extern.h"
     12  1.1       cgd 
     13  1.1       cgd /*
     14  1.1       cgd  *	routine to take a nap for n milliseconds
     15  1.1       cgd  */
     16  1.5  christos void
     17  1.1       cgd nap(x)
     18  1.5  christos 	int    x;
     19  1.5  christos {
     20  1.5  christos 	if (x <= 0)
     21  1.5  christos 		return;		/* eliminate chance for infinite loop */
     22  1.1       cgd 	lflush();
     23  1.5  christos 	usleep(x * 1000);
     24  1.5  christos }
     25