charmbracelet / charmbracelet/bubbletea

Stopwatch example does not run correctly on Windows

Open
#932 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
44.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

[Stopwatch example](https://github.com/charmbracelet/bubbletea/blob/master/examples/stopwatch/main.go) does not run as expected on Windows when using
```go
m := model{
stopwatch: stopwatch.NewWithInterval(time.Millisecond),
}
```
The count changes within 1000ms for a while, but actually lasts a few seconds
When using
```go
m := model{
stopwatch: stopwatch.NewWithInterval(time.Second),
}
```
it runs as expected
BTW, runs fine on Mac
I don't know how to fix it when using time.Millisecond

Contributor guide

Open the contributing guide

Research direction

Start with examples/stopwatch/main.go and run the example on Windows using time.Millisecond, comparing its behavior with the time.Second interval and the Mac result described here. Trace the stopwatch.NewWithInterval path to identify why millisecond timing drifts; done means the millisecond stopwatch advances at the expected interval on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.