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: Add (*Ticker) Start() #7883

Closed
gopherbot opened this issue Apr 28, 2014 · 1 comment
Closed

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

gopherbot opened this issue Apr 28, 2014 · 1 comment

Comments

@gopherbot
Copy link

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()
@ianlancetaylor
Copy link
Contributor

Comment 1:

A simple API is preferable.  We should not complicate it for an unusual use case, if
that use case can be implemented in some other way.  In particular, consider using a
Timer, which supports a Reset method.

Status changed to WontFix.

@golang golang locked and limited conversation to collaborators Jun 25, 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

2 participants