async Task Profile(CancellationToken canceller) { // auto profile var mask = new GameEntityMask(null, null, null); using (var gridProfiler = new GridProfiler(mask)) using (var playerProfiler = new PlayerProfiler(mask)) using (ProfilerResultQueue.Profile(gridProfiler)) using (ProfilerResultQueue.Profile(playerProfiler)) { Log.Trace("auto-profile started"); gridProfiler.MarkStart(); playerProfiler.MarkStart(); await Task.Delay(_config.IntervalFrequency.Seconds(), canceller); Log.Trace("auto-profile done"); _grids.Update(gridProfiler.GetResult()); _players.Update(playerProfiler.GetResult()); } Log.Trace("profile done"); }