Skip to content

fix(stopwatch): wall-clock elapsed time and 1s default interval#984

Open
leno23 wants to merge 1 commit into
charmbracelet:mainfrom
leno23:fix/stopwatch-wall-clock-and-default-interval
Open

fix(stopwatch): wall-clock elapsed time and 1s default interval#984
leno23 wants to merge 1 commit into
charmbracelet:mainfrom
leno23:fix/stopwatch-wall-clock-and-default-interval

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

This also fixes the Windows stopwatch example where millisecond ticks batch in the event loop but real time advances normally (bubbletea#932).

Test plan

  • go test ./stopwatch/...

Made with Cursor

Track elapsed duration from real time instead of tick count so the
display stays accurate when the event loop delivers ticks late (e.g.
Windows with sub-second intervals). Initialize Interval to one second
as documented.

Fixes charmbracelet#862
Fixes charmbracelet#237
Fixes charmbracelet/bubbletea#932
@leno23 leno23 force-pushed the fix/stopwatch-wall-clock-and-default-interval branch from 313d504 to c5f4c05 Compare May 17, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant