// The main server loop public void MainLoop() { basePeriod = 1; period = basePeriod; var timerQueue = new TimerQueue(); stopWatch.Start(); mainLoopTimer = timerQueue.CreateTimer(s => { RunLoop(); }, null, 0, period); while (Active) { are.WaitOne(-1); DoMainLoopStuff(); } /* TimerCallback tcb = RunLoop; * var due = 1;// (long)ServerRate / 3; * stopWatch.Start(); //Start the clock * mainLoopTimer = new Timer(tcb, are, 0, due); * are.WaitOne(-1);*/ }
// The main server loop public void MainLoop() { basePeriod = 1; period = basePeriod; var timerQueue = new TimerQueue(); stopWatch.Start(); mainLoopTimer = timerQueue.CreateTimer(s => { RunLoop(); }, null, 0, period); while (Active) { are.WaitOne(-1); DoMainLoopStuff(); } /* TimerCallback tcb = RunLoop; var due = 1;// (long)ServerRate / 3; stopWatch.Start(); //Start the clock mainLoopTimer = new Timer(tcb, are, 0, due); are.WaitOne(-1);*/ }