summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/ap/plan9/sleep.c
blob: a6fcf19a9bf5151e77005b92005dc91433d0d967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "lib.h"
#include <unistd.h>
#include <time.h>
#include "sys9.h"

unsigned int
sleep(unsigned int secs)
{
	time_t t0, t1;

	t0 = time(0);
	if(_SLEEP(secs*1000) < 0){
		t1 = time(0);
		return t1-t0;
	}
	return 0;
}