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