From ec278c9dfb71d9ccebacc858240a08d02c758b88 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 7 Oct 2009 19:12:16 +0000 Subject: added LLFastTimer::dumpCurTimes reviewed by James --- indra/llcommon/llfasttimer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcommon/llfasttimer.h') diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 0d89353dee..c6aa5f2195 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -215,6 +215,10 @@ public: // call this once a frame to reset timers static void nextFrame(); + // dumps current cumulative frame stats to log + // call nextFrame() to reset timers + static void dumpCurTimes(); + // call this to reset timer hierarchy, averages, etc. static void reset(); -- cgit v1.2.3 From 584d0ac64e973da3a9096fb85b796716255988be Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 7 Oct 2009 21:17:28 +0000 Subject: LLFastTimer::dumpCurTimes() now gives accurate times mid-frame reviewed by Brad --- indra/llcommon/llfasttimer.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/llcommon/llfasttimer.h') diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index c6aa5f2195..c2f23f6ff6 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -114,8 +114,9 @@ public: // recursive call to gather total time from children static void accumulateTimings(); - // called once per frame by LLFastTimer - static void processFrame(); + // updates cumulative times and hierarchy, + // can be called multiple times in a frame, at any point + static void processTimes(); static void buildHierarchy(); static void resetFrame(); @@ -178,8 +179,9 @@ public: { #if FAST_TIMER_ON NamedTimer::FrameState* frame_state = mFrameState; - frame_state->mLastStartTime = get_cpu_clock_count(); - mStartSelfTime = frame_state->mLastStartTime; + U64 cur_time = get_cpu_clock_count(); + frame_state->mLastStartTime = cur_time; + mStartSelfTime = cur_time; frame_state->mActiveCount++; frame_state->mCalls++; -- cgit v1.2.3