Skip to content

std.time: renamed Timer to Stopwatch #24372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zacoons
Copy link

@zacoons zacoons commented Jul 8, 2025

"Timer" is commonly associated with something which triggers after a specified amount of time has elapsed.
"Stopwatch" is closer to what this class is for: measuring how much time has elapsed since it began.

This will be a breaking change for many.

@nektro suggested I open a PR to get comments from the dev team.

@xydone
Copy link

xydone commented Jul 16, 2025

The only mainstream programming language (which I'm aware about) which implements something that behaves the same way as Zig's std.time.Timer and calls it Stopwatch is C#, most other languages have neither of the two in the name and opt for different, albeit also ambiguous wording. While Stopwatch is the more semantically more accurate than Timer, I think this is just a breaking change with no massive benefits to it.

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.

2 participants