void onTimerElapsed(object sender, ElapsedEventArgs e) { if (!_timer.AutoReset) { _timer.Interval = Interval.TotalMilliseconds; _timer.AutoReset = true; _timer.Start(); } Action action = Action; if (action != null) { _current = this; try { action(); } finally { _current = null; } } }