- Changed Linux to use clock_gettime for profiling instead of rdtsc. This

avoids potential erroneous results on multicore and variable speed
  processors. Windows will need to be updated accordingly.



SVN r1142 (trunk)
This commit is contained in:
Randy Heit 2008-08-10 03:25:08 +00:00
commit ad96225213
21 changed files with 399 additions and 540 deletions

View file

@ -406,9 +406,11 @@ void DThinker::RunThinkers ()
{
int i, count;
ThinkCycles = BotSupportCycles = BotWTG = 0;
ThinkCycles.Reset();
BotSupportCycles.Reset();
BotWTG.Reset();
clock (ThinkCycles);
ThinkCycles.Clock();
// Tick every thinker left from last time
for (i = STAT_FIRST_THINKING; i <= MAX_STATNUM; ++i)
@ -426,7 +428,7 @@ void DThinker::RunThinkers ()
}
} while (count != 0);
unclock (ThinkCycles);
ThinkCycles.Unclock();
}
int DThinker::TickThinkers (FThinkerList *list, FThinkerList *dest)
@ -571,7 +573,6 @@ DThinker *FThinkerIterator::Next ()
ADD_STAT (think)
{
FString out;
out.Format ("Think time = %04.1f ms",
SecondsPerCycle * (double)ThinkCycles * 1000);
out.Format ("Think time = %04.1f ms", ThinkCycles.TimeMS());
return out;
}