Skip to content

Commit 50d2d74

Browse files
committed
Fix 100% cpu usage
1 parent 37666d4 commit 50d2d74

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

joystick_driver.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/hybridgroup/gobot"
77
"github.com/jackyb/go-sdl2/sdl"
88
"io/ioutil"
9+
"time"
910
)
1011

1112
type JoystickDriver struct {
@@ -108,6 +109,7 @@ func (me *JoystickDriver) Start() bool {
108109
}
109110
}
110111
}
112+
time.Sleep(10 * time.Millisecond)
111113
}
112114
}()
113115
return true

0 commit comments

Comments
 (0)