Skip to content

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

@remyoudompheng

Description

@remyoudompheng
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions