diff options
Diffstat (limited to 'tools/console.zig')
| -rw-r--r-- | tools/console.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/console.zig b/tools/console.zig index 4b13513..39a829b 100644 --- a/tools/console.zig +++ b/tools/console.zig @@ -336,7 +336,7 @@ pub fn attach(port_path: []const u8, baud: serial.Baud, opts: Options) !void { // A bounded wait, and shorter while a motion report is being held: the hold has to end on // time even when the human has stopped moving the mouse and nothing else is arriving. const wait: i32 = if (held_at) |at| blk: { - const left = coalesce_ms - (std.time.milliTimestamp() - at); + const left = coalesce_ms - (port.nowMs() - at); break :blk if (left <= 0) 0 else @intCast(left); } else 200; const ready = posix.poll(&pfd, wait) catch continue; @@ -385,9 +385,9 @@ pub fn attach(port_path: []const u8, baud: serial.Baud, opts: Options) !void { // The coalescing window. A held motion report goes out when the interval has elapsed, which // is what turns a drag into a bounded stream of positions rather than one per cell crossed. if (mouse.pending()) { - const at = held_at orelse std.time.milliTimestamp(); + const at = held_at orelse port.nowMs(); held_at = at; - if (std.time.milliTimestamp() - at >= coalesce_ms) { + if (port.nowMs() - at >= coalesce_ms) { const send = mouse.flushHeld(&to_board); if (send > 0) port.write(to_board[0..send]) catch {}; held_at = null; |
