private void TimerServices_ElapsedHandler(object sender, EventArgs e) { RegisterCycleCompleted(); TotalElapsedMillisecondsUntilLastCycle += _timerServices.IntervalProgress; DetailedElapseEventArgs args = new DetailedElapseEventArgs(CyclesCompleted, CyclesLeft, TimeSpan.FromMilliseconds(_timerServices.IntervalProgress), /*DateTimeHelper.PreciseCurrentLocalTime - _starTime*/ TimeSpan.FromMilliseconds(_totalElapsedUntilLastCycle)); DetailedElapsedEventHandler handler = Elapsed; if (handler == null) return; handler(this, args); }
private void TimerServices_ElapsedHandler(object sender, EventArgs e) { RegisterCycleCompleted(); TotalElapsedMillisecondsUntilLastCycle += _timerServices.IntervalProgress; DetailedElapseEventArgs args = new DetailedElapseEventArgs(CyclesCompleted, CyclesLeft, TimeSpan.FromMilliseconds(_timerServices.IntervalProgress), /*DateTimeHelper.PreciseCurrentLocalTime - _starTime*/ TimeSpan.FromMilliseconds(_totalElapsedUntilLastCycle)); DetailedElapsedEventHandler handler = Elapsed; if (handler == null) { return; } handler(this, args); }
static void timer_Elapsed(IHyperTimer sender, DetailedElapseEventArgs args) { Console.WriteLine("Cycles Completed:{0}, Cycles Left: {1} TE: {2} Prog: {3}", args.CyclesCompleted, args.CyclesLeft, args.TotalElapsed, args.Elapsed); _total += args.Elapsed; }