/timerpool

Primary LanguageGoMIT LicenseMIT

timerpool

License MIT GoDoc Go Report Card Build Status codecov

sync.Pool of reusable timer.Timer with constant timeout passed.

Get the package using:

$ go get -u -v github.com/mkorolyov/timerpool

Usage

Create a pool with

pool := New(time.Second)

then in a hot peace of code acquire the timer and don't forget to release it.

timer := pool.Acquire()
// use it
pool.Release(timer)