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