xref: /netbsd-src/games/larn/nap.c (revision c34afa686bf074a6dcc7f17157faae72111dde9a)
1*c34afa68Sdholland /*	$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $	*/
2210cab45Smycroft 
361f28255Scgd /* nap.c		 Larn is copyrighted 1986 by Noah Morgan. */
4a8fba37dSchristos #include <sys/cdefs.h>
5a8fba37dSchristos #ifndef lint
6*c34afa68Sdholland __RCSID("$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $");
7a8fba37dSchristos #endif				/* not lint */
8a8fba37dSchristos 
9a8fba37dSchristos #include <unistd.h>
10a8fba37dSchristos #include "header.h"
11a8fba37dSchristos #include "extern.h"
1261f28255Scgd 
1361f28255Scgd /*
1461f28255Scgd  *	routine to take a nap for n milliseconds
1561f28255Scgd  */
16a8fba37dSchristos void
nap(int x)17*c34afa68Sdholland nap(int x)
1861f28255Scgd {
19a8fba37dSchristos 	if (x <= 0)
20a8fba37dSchristos 		return;		/* eliminate chance for infinite loop */
2161f28255Scgd 	lflush();
22079d9a1dSmycroft 	usleep(x * 1000);
2361f28255Scgd }
24