File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ impl EventLoop {
110
110
if let Some ( timer) = guard_sched. peek ( ) {
111
111
let tick = Instant :: now ( ) . duration_since ( self . epoch ) . as_micros ( ) ;
112
112
if timer. when > tick {
113
- let dt = ( ( timer. when - tick) / 1000 ) as u64 ;
113
+ let dt = ( timer. when - tick) as u64 ;
114
114
sched_time = Some ( dt) ;
115
115
}
116
116
}
@@ -128,7 +128,7 @@ impl EventLoop {
128
128
if sched_time. is_none ( ) {
129
129
self . idle . store ( true , atomic:: Ordering :: Release ) ;
130
130
}
131
- let res = io. poll ( & mut state. events , sched_time. map ( Duration :: from_millis ) ) ;
131
+ let res = io. poll ( & mut state. events , sched_time. map ( Duration :: from_micros ) ) ;
132
132
if let Err ( ref err) = res {
133
133
if err. kind ( ) == std:: io:: ErrorKind :: Interrupted {
134
134
// if we got an interrupt, we retry ready events (as we might need to process signals)
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def stop():
27
27
loop .stop ()
28
28
29
29
loop .call_later (0.001 , cb , 2 )
30
- loop .call_later (1.0 , stop )
30
+ loop .call_later (0.1 , stop )
31
31
loop .call_soon (cb , 1 )
32
32
loop .run_forever ()
33
33
assert calls == [1 , 2 ]
You can’t perform that action at this time.
0 commit comments