Browse Source

usec is Microsecond, not Millisecond.

Steve Thielemann 3 years ago
parent
commit
8e9408d10a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      door/input.go

+ 2 - 1
door/input.go

@@ -259,6 +259,7 @@ func (d *Door) Key() int {
 	return d.WaitKey(Inactivity, 0)
 }
 
+// usecs = Microseconds
 func (d *Door) WaitKey(secs int64, usecs int64) int {
 	if d.Disconnected {
 		return -2
@@ -268,7 +269,7 @@ func (d *Door) WaitKey(secs int64, usecs int64) int {
 		return d.GetKey()
 	}
 
-	timeout := time.Duration(secs)*time.Second + time.Duration(usecs)*time.Millisecond
+	timeout := time.Duration(secs)*time.Second + time.Duration(usecs)*time.Microsecond
 
 	select {
 	case res, ok := <-readerChannel: