1 use std
::time
::Duration
;
3 use windows
::Win32
::{Foundation
::HANDLE
, System
::Threading
::*};
10 pub fn new() -> Self {
13 timer_handle
: CreateWaitableTimerExW(
15 windows
::core
::PCWSTR
::null(),
16 CREATE_WAITABLE_TIMER_MANUAL_RESET
| CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
,
24 pub fn wait(&self, d
: Duration
) {
25 let time
= d
.as_micros() as i64 * -10;
27 SetWaitableTimer(self.timer_handle
, &time
, 0, None
, None
, false).unwrap();
28 WaitForSingleObject(self.timer_handle
, INFINITE
);