Skip to content

time: Add (*Ticker) Start() #7883

@gopherbot

Description

@gopherbot

by opennota:

Some use cases for tickers require stopping the ticker and restarting it later.  This
behaviour can be emulated using time.After, but it requires creating new timers each
time you want to restart it.  I suggest to add the following methods:

  // NewUnstartedTicker returns a new ticker, but does not start it.
  func NewUnstartedTicker(d Duration) *Ticker

  // Start starts stopped or unstarted ticker.
  func (*Ticker) Start()

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