/// <summary> /// CallBack for timer /// </summary> /// <param name="arg"> Unused argument because we must not transfert state to callback during the callback.</param> private void HandleTick(object arg) { var nextLastCheck = _watch.ElapsedMilliseconds; var newValue = _updater.UpdateValue(nextLastCheck - _lastCheck); _lastCheck = nextLastCheck; _current = _current.UpDateValue(newValue); _mdProducer.Post(_current); }