Procházet zdrojové kódy

usec is Microsecond, not Millisecond.

Steve Thielemann před 3 roky
rodič
revize
8e9408d10a
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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: