Commit Graph

3 Commits

Author SHA1 Message Date
Lynn Lin be904beebc fix spelling typo 2017-08-28 08:57:51 +08:00
beorn7 bc365741ee Improve timer examples 2016-11-21 19:16:56 +01:00
beorn7 89ca0458cb Change the Timer API
This finally makes the (presumably) common simple case as simple as it
gets.

The still quite common (but less common) case of using a Gauge is
slightly more verbose now, but not needing to provide a separate
constructor is totally worth it.

Finally, the advanced use case is not really more verbose as in my
original suggestion. However, the logic to decide which Observer to
use is now all in the ObserverFunc handed in at construction
time. This is deliberate and desired. It makes sure the selection
mechanism is all spelled out there. No surprises buried deep in the
function code somewhere.
2016-11-18 20:32:18 +01:00