NetBSD/games/larn/nap.c

24 lines
475 B
C
Raw Normal View History

2012-06-19 09:30:43 +04:00
/* $NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $ */
1993-03-21 12:45:37 +03:00
/* nap.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
2012-06-19 09:30:43 +04:00
__RCSID("$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <unistd.h>
#include "header.h"
#include "extern.h"
1993-03-21 12:45:37 +03:00
/*
* routine to take a nap for n milliseconds
*/
void
2012-06-19 09:30:43 +04:00
nap(int x)
{
if (x <= 0)
return; /* eliminate chance for infinite loop */
1993-03-21 12:45:37 +03:00
lflush();
usleep(x * 1000);
}