From e6b4f9ff099bd6c4bcffa1b267d458031e234e07 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 27 Feb 2021 20:53:27 +0300 Subject: [PATCH] time: fix sleep() on windows --- vlib/time/time_windows.c.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/time/time_windows.c.v b/vlib/time/time_windows.c.v index 4a0a76d4c4..1aa9bef937 100644 --- a/vlib/time/time_windows.c.v +++ b/vlib/time/time_windows.c.v @@ -214,6 +214,12 @@ pub struct C.timeval { } // wait makes the calling thread sleep for a given duration (in nanoseconds). +[deprecated: 'call time.sleep(n * time.second)'] pub fn wait(duration Duration) { C.Sleep(int(duration / millisecond)) } + +// sleep makes the calling thread sleep for a given duration (in nanoseconds). +pub fn sleep(duration Duration) { + C.Sleep(int(duration / millisecond)) +}