Home | History | Annotate | Line # | Download | only in larn
nap.c revision 1.5.68.1
      1  1.5.68.1      yamt /*	$NetBSD: nap.c,v 1.5.68.1 2012/10/30 18:58:24 yamt 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.68.1      yamt __RCSID("$NetBSD: nap.c,v 1.5.68.1 2012/10/30 18:58:24 yamt 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.5.68.1      yamt nap(int x)
     18       1.5  christos {
     19       1.5  christos 	if (x <= 0)
     20       1.5  christos 		return;		/* eliminate chance for infinite loop */
     21       1.1       cgd 	lflush();
     22       1.5  christos 	usleep(x * 1000);
     23       1.5  christos }
     24