Skip to content
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

add Until method on clock interface #85

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

WillMatthews
Copy link
Contributor

The clockwork package has a Since method for measuring duration between a time in the past and the current time.
The go standard lib time has an Until method, in addition to Since.
There's quite a few cases (at least, in my software) where it would be far 'neater' to have Until than doing the negative of Since.

This PR adds an Until method to the clock interface, with tests.
I am not sure on what the general philosophy around this package is - i.e. if you even want Until, but I thought it would be worthwhile to open a PR.

Thank you for your work on Clockwork, I would be delighted to have any feedback to try and make my contributions better 😄

@DPJacques DPJacques merged commit 33fc064 into jonboulle:master Aug 23, 2024
8 checks passed
@WillMatthews WillMatthews deleted the until branch August 23, 2024 16:51
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