public void RegisterProfiler(DebugProfiler profiler) { foreach (DebugProfiler item in profilers) if (item == profiler) return; profilers.Add(profiler); }
public void Run() { var sw = new Stopwatch(); sw.Start(); IntMath.Sqrt(0); // init static while (true) { if (GameTimeService.Ticks >= GameTimeService.TicksPerSecond * 20) { Console.WriteLine($"Done! {sw.Elapsed.TotalSeconds} at tick {GameTimeService.Ticks}"); break; } Tick(); } var latch = new CountdownEvent(1); new Thread(() => { DebugProfiler.DumpToClipboard(); latch.Signal(); }) { ApartmentState = ApartmentState.STA }.Start(); latch.Wait(); }
public void Tick() { DebugProfiler.EnterTick(GameTimeService.Ticks); GameEventQueueService.ProcessPendingGameEvents(out var eventsProcessed); EntityService.ProcessSystems(); DebugProfiler.LeaveTick(); foreach (var debugger in Debuggers) { debugger.HandleFrameEnd(new FrameEndStatistics { EventsProcessed = eventsProcessed }); } GameTimeService.IncrementTicks(); }