URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [misc/] [sleep.c] - Rev 199
Go to most recent revision | Compare with Previous | Blame | View Log
#include <sys/time.h> #include <sys/types.h> #include <unistd.h> void usleep(unsigned long usec) { struct timeval tv; tv.tv_sec = usec / 1000000; tv.tv_usec = usec % 1000000; select(0,0,0,0, &tv); } int sleep(unsigned int sec) { struct timeval tv; tv.tv_sec = sec; tv.tv_usec = 0; select(0,0,0,0, &tv); return tv.tv_sec; }
Go to most recent revision | Compare with Previous | Blame | View Log