all: fetch current time only once per iteration
This commit is contained in:
parent
d8d6be1ef3
commit
bb9e6ba3b5
21 changed files with 99 additions and 97 deletions
|
|
@ -5,7 +5,6 @@ use {
|
|||
ifs::ext_idle_notification_v1::ExtIdleNotificationV1,
|
||||
leaks::Tracker,
|
||||
object::{Object, Version},
|
||||
time::now_usec,
|
||||
utils::errorfmt::ErrorFmt,
|
||||
wire::{ext_idle_notifier_v1::*, ExtIdleNotifierV1Id},
|
||||
},
|
||||
|
|
@ -81,7 +80,7 @@ impl ExtIdleNotifierV1RequestHandler for ExtIdleNotifierV1 {
|
|||
|
||||
async fn run(n: Rc<ExtIdleNotificationV1>) {
|
||||
loop {
|
||||
let now = now_usec();
|
||||
let now = n.client.state.now_usec();
|
||||
let elapsed = now.saturating_sub(n.seat.last_input());
|
||||
if elapsed < n.duration_usec {
|
||||
let res = n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue