Skip to content

time: add (*Timer).Reset(d Duration) #4412

@Sajmani

Description

@Sajmani
Some use cases for timers require extending the timer's deadline or resetting it to fire
again.  Implementing this using the existing time functions NewTimer and AfterFunc is
somewhat awkward and error-prone.  Instead, let's add:
  // Reset resets the time remaining on the timer to d.
  func (*Timer) Reset(d Duration)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions