Skip to content

Commit

Permalink
fix: avoid CPU thrashing when waiting for telemetry updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vwhitteron committed Feb 27, 2024
1 parent 6020c98 commit 8de7c72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func main() {

fmt.Println("Waiting for data... Press Ctrl+C to exit")

sequenceId := uint32(0)
sequenceID := uint32(0)
for {
if sequenceId == client.Telemetry.SequenceID() {
if sequenceID == client.Telemetry.SequenceID() {
time.Sleep(8 * time.Millisecond)
continue
}
sequenceId = client.Telemetry.SequenceID()
sequenceID = client.Telemetry.SequenceID()

suggestedGear := client.Telemetry.SuggestedGear()
suggestedGearStr := fmt.Sprintf("[%d]", suggestedGear)
Expand Down

0 comments on commit 8de7c72

Please sign in to comment.