Use a time.Ticker instead of the time.Sreep

This also prevents writing the metrics immediately after calling `WriteJSON`, which would likely be an empty registry in the beginning.