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

Comments

Projects
None yet
4 participants
@remyoudompheng
Copy link
Contributor

commented Jan 18, 2012

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

commented Jan 19, 2012

Comment 2:

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

@rsc

This comment has been minimized.

Copy link
Contributor

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.
You can’t perform that action at this time.