1997-10-19 00:03:05 +04:00
|
|
|
/* $NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $ */
|
1993-08-02 21:18:41 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/* nap.c Larn is copyrighted 1986 by Noah Morgan. */
|
1997-10-19 00:03:05 +04:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#ifndef lint
|
|
|
|
__RCSID("$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos 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
|
|
|
|
*/
|
1997-10-19 00:03:05 +04:00
|
|
|
void
|
1993-03-21 12:45:37 +03:00
|
|
|
nap(x)
|
1997-10-19 00:03:05 +04:00
|
|
|
int x;
|
|
|
|
{
|
|
|
|
if (x <= 0)
|
|
|
|
return; /* eliminate chance for infinite loop */
|
1993-03-21 12:45:37 +03:00
|
|
|
lflush();
|
1997-10-19 00:03:05 +04:00
|
|
|
usleep(x * 1000);
|
|
|
|
}
|