From 9dc89331097037d6de6d443c7cd938a18a3cb862 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Apr 2017 12:30:03 +0200 Subject: [PATCH] - let 'stat think' also print the number of active thinkers. --- src/dthinker.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index cbac457c65..af1771c5b8 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -43,6 +43,7 @@ #include "virtual.h" +static int ThinkCount; static cycle_t ThinkCycles; extern cycle_t BotSupportCycles; extern cycle_t ActionCycles; @@ -462,6 +463,7 @@ void DThinker::RunThinkers () { int i, count; + ThinkCount = 0; ThinkCycles.Reset(); BotSupportCycles.Reset(); ActionCycles.Reset(); @@ -525,6 +527,7 @@ int DThinker::TickThinkers (FThinkerList *list, FThinkerList *dest) if (!(node->ObjectFlags & OF_EuthanizeMe)) { // Only tick thinkers not scheduled for destruction + ThinkCount++; node->CallTick(); node->ObjectFlags &= ~OF_JustSpawned; GC::CheckGC(); @@ -753,6 +756,6 @@ DEFINE_ACTION_FUNCTION(DThinkerIterator, Reinit) ADD_STAT (think) { FString out; - out.Format ("Think time = %04.2f ms, Action = %04.2f ms", ThinkCycles.TimeMS(), ActionCycles.TimeMS()); + out.Format ("Think time = %04.2f ms - %d thinkers, Action = %04.2f ms", ThinkCycles.TimeMS(), ThinkCount, ActionCycles.TimeMS()); return out; }