summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfasttimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rw-r--r--indra/llcommon/llfasttimer.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 726db70fbe..28e54a37de 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -71,9 +71,13 @@ public:
BlockTimer(TimeBlock& timer);
~BlockTimer();
+ LLUnit<LLUnits::Seconds, F64> getElapsedTime();
+
private:
U64 mStartTime;
+ U64 mStartSelfTimeCounter;
+ U64 mStartChildTimeCounter;
BlockTimerStackRecord mParentTimerData;
};
@@ -279,6 +283,8 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer)
BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists();
TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator();
accumulator->mActiveCount++;
+ mStartSelfTimeCounter = accumulator->mSelfTimeCounter;
+ mStartChildTimeCounter = accumulator->mChildTimeCounter;
// keep current parent as long as it is active when we are
accumulator->mMoveUpTree |= (accumulator->mParent->getPrimaryAccumulator()->mActiveCount == 0);
@@ -298,9 +304,12 @@ LL_FORCE_INLINE BlockTimer::~BlockTimer()
BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists();
TimeBlockAccumulator* accumulator = cur_timer_data->mTimeBlock->getPrimaryAccumulator();
+ U64 child_time = cur_timer_data->mChildTime
+ - (accumulator->mSelfTimeCounter - mStartSelfTimeCounter)
+ - (accumulator->mChildTimeCounter - mStartChildTimeCounter);
accumulator->mCalls++;
- accumulator->mChildTimeCounter += cur_timer_data->mChildTime;
- accumulator->mTotalTimeCounter += total_time;
+ accumulator->mChildTimeCounter += child_time;
+ accumulator->mSelfTimeCounter += total_time - cur_timer_data->mChildTime;
accumulator->mActiveCount--;
// store last caller to bootstrap tree creation