diff options
Diffstat (limited to 'indra/llcommon')
| -rwxr-xr-x | indra/llcommon/llfasttimer.cpp | 2 | ||||
| -rw-r--r-- | indra/llcommon/llunit.h | 15 | 
2 files changed, 14 insertions, 3 deletions
| diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 6f046c18ff..f4c87ab6f6 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -397,7 +397,7 @@ void TimeBlock::dumpCurTimes()  		}  		out_str << timerp->getName() << " "  -			<< std::setprecision(3) << total_time.valueAs<LLUnits::Milliseconds>() << " ms, " +			<< std::setprecision(3) << total_time.valueInUnits<LLUnits::Milliseconds>() << " ms, "  			<< num_calls << " calls";  		llinfos << out_str.str() << llendl; diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 781a4ab731..2e4c0de28f 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -74,10 +74,21 @@ struct LLUnit  		return mValue;  	} +	void value(storage_t value) +	{ +		mValue = value; +	} + +	template<typename NEW_UNIT_TYPE>  +	storage_t valueInUnits() +	{ +		return LLUnit<storage_t, NEW_UNIT_TYPE>(*this).value(); +	} +  	template<typename NEW_UNIT_TYPE>  -	STORAGE_TYPE valueAs() +	void valueInUnits(storage_t value)  	{ -		return LLUnit<STORAGE_TYPE, NEW_UNIT_TYPE>(*this).value(); +		*this = LLUnit<storage_t, NEW_UNIT_TYPE>(value);  	}  	void operator += (storage_t value) | 
