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

time: consider adding NewTimerAt(t Time) and At(t Time) functions #2729

Closed
remyoudompheng opened this issue Jan 18, 2012 · 3 comments
Closed

Comments

@remyoudompheng
Copy link
Contributor

Hello,

I'd like to make a feature request for a "At" and "NewTimerAt"
functions to the time package. They would be similar to After() and NewTimer(), except
that instead of specifying a duration, they specify a instant in time and at some point
after that time, the current time is sent to the channel.

Such functions would:
- be useful to schedule code execution or implement crontab-like functionality
- be closer to what is actually implemented by the runtime

It is not clear whether it can be emulated with the current After() and NewTimer(),
since they internally syscall nanotime() which may return after an indeterminate
duration.

Rémy.
@rsc
Copy link
Contributor

rsc commented Jan 18, 2012

Comment 1:

I don't think these are needed.
time.After(when.Sub(time.Now()))
does exactly what you'd like it to do.
Russ

@dsymonds
Copy link
Contributor

Comment 2:

Labels changed: added priority-someday, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Jan 29, 2012

Comment 3:

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants