2
0
mirror of https://github.com/status-im/status-go.git synced 2025-01-15 17:25:20 +00:00
2022-04-06 11:48:16 +02:00

16 lines
265 B
Go

package missinggo
import (
"math"
"time"
)
// Returns a time.Timer that calls f. The timer is initially stopped.
func StoppedFuncTimer(f func()) (t *time.Timer) {
t = time.AfterFunc(math.MaxInt64, f)
if !t.Stop() {
panic("timer already fired")
}
return
}