Example #1
0
 public PersistentCounter()
 {
     _timer = new Timer(_ => {
         if (Running)
         {
             Value++;
             CounterUpdated?.Invoke(this, Value);
         }
     });
     _timer.Change(0, 1000);
 }
Example #2
0
 private void OnTimer(int counter)
 {
     CounterUpdated?.Invoke(counter);
 }