private void GameMain_gameUpdateEvent(GameTime gameTime) { if (_works.Count > 0) { lock (_syncWorks) { TimeSpan totalDelta = TimeSpan.Zero; int execWorkCount = 0; int totalWorks = _works.Count; for (int i = 0; i < _works.Count;) { var t1 = DateTime.Now; IWork work = _works[i]; _works.RemoveAt(i); work.run(gameTime); var delta = DateTime.Now - t1; totalDelta += delta; if (totalDelta.TotalSeconds > 0.01f) { break; } execWorkCount++; } if (execWorkCount > 0) { // Console.WriteLine("execWork={0}/{1} totalDelta={2}", execWorkCount, totalWorks, totalDelta); } } } }