aboutsummaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/unix/core.c b/src/unix/core.c
index ffce948c..2d5479af 100644
--- a/src/unix/core.c
+++ b/src/unix/core.c
@@ -1555,3 +1555,15 @@ int uv_gettimeofday(uv_timeval64_t* tv) {
tv->tv_usec = (int32_t) time.tv_usec;
return 0;
}
+
+void uv_sleep(unsigned int msec) {
+ unsigned int sec;
+ unsigned int usec;
+
+ sec = msec / 1000;
+ usec = (msec % 1000) * 1000;
+ if (sec > 0)
+ sleep(sec);
+ if (usec > 0)
+ usleep(usec);
+}