Skip to content

Commit 03e4013

Browse files
committed
Use canonical way to deal with durations.
1 parent 9028e3a commit 03e4013

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shift-shift.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func listenKeyboards(
225225
kbdLost := make(chan bool, 8)
226226
kbdLost <- true // init
227227
if dblKeystroke {
228-
t = time.NewTimer(time.Duration(dblKeyTimeout * 1000 * 1000))
228+
t = time.NewTimer(time.Duration(dblKeyTimeout) * time.Millisecond)
229229
}
230230

231231
go scanDevices(inbox, deviceMatch, quietMode, scanOnce)
@@ -314,6 +314,6 @@ func checkTimeout(t *time.Timer, timeout int) (*time.Timer, bool) {
314314
if t.Stop() {
315315
return t, true
316316
}
317-
t.Reset(time.Duration(timeout * 1000 * 1000))
317+
t.Reset(time.Duration(timeout) * time.Millisecond)
318318
return t, false
319319
}

0 commit comments

Comments
 (0)