aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/unix/core.c12
-rw-r--r--src/win/util.c4
2 files changed, 16 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);
+}
diff --git a/src/win/util.c b/src/win/util.c
index 4bbeb315..4de638f5 100644
--- a/src/win/util.c
+++ b/src/win/util.c
@@ -1873,3 +1873,7 @@ int uv__random_rtlgenrandom(void* buf, size_t buflen) {
return 0;
}
+
+void uv_sleep(unsigned int msec) {
+ Sleep(msec);
+}