Home | History | Annotate | Line # | Download | only in larn
      1  1.6  dholland /*	$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland 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.6  dholland __RCSID("$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland 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.6  dholland 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