diff options
Diffstat (limited to 'com32/lib/sys')
-rw-r--r-- | com32/lib/sys/sleep.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/com32/lib/sys/sleep.c b/com32/lib/sys/sleep.c new file mode 100644 index 00000000..8a51c1c0 --- /dev/null +++ b/com32/lib/sys/sleep.c @@ -0,0 +1,22 @@ +/* + * sys/sleep.c + */ + +#include <unistd.h> +#include <sys/times.h> +#include <syslinux/idle.h> + +unsigned int msleep(unsigned int msec) +{ + clock_t start = times(NULL); + + while (times(NULL) - start < msec) + syslinux_idle(); + + return 0; +} + +unsigned int sleep(unsigned int seconds) +{ + return msleep(seconds * 1000); +} |