]> Cypherpunks repositories - gostls13.git/commit
time: add Ticker.Reset
authorChangkun Ou <hi@changkun.us>
Mon, 3 Feb 2020 13:42:32 +0000 (14:42 +0100)
committerIan Lance Taylor <iant@golang.org>
Sun, 23 Feb 2020 16:09:02 +0000 (16:09 +0000)
commit6e5652bebede2d53484a872f6d1dfeb498b0b50c
tree09afe930fe45f4238275e2e28df44a44fa82acb9
parentebe49b2c2999a7d4128c44aed9602a69fdc53d16
time: add Ticker.Reset

This CL implements Ticker.Reset method in time package.

Benchmark:
name                 time/op
TickerReset-12       6.41µs ±10%
TickerResetNaive-12  95.7µs ±12%

Fixes #33184

Change-Id: I12c651f81e452541bcbbc748b45f038aae1f8dae
Reviewed-on: https://go-review.googlesource.com/c/go/+/217362
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
api/next.txt
doc/go1.15.html
src/runtime/time.go
src/time/sleep.go
src/time/tick.go
src/time/tick_test.go