mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
Update writer.go
This commit is contained in:
parent
e0d81d1e99
commit
51dc82d6a4
1 changed files with 3 additions and 1 deletions
|
|
@ -11,7 +11,9 @@ import (
|
|||
// Write sorts writes each metric in the given registry periodically to the
|
||||
// given io.Writer.
|
||||
func Write(r Registry, d time.Duration, w io.Writer) {
|
||||
for range time.Tick(d) {
|
||||
ticker := time.NewTicker(d)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
WriteOnce(r, w)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue