From ed17c181dd37f56b808838748d289ee7bb5567ec Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 7 Nov 2012 15:32:12 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct further fixes to implicit conversion of unit types --- indra/llcommon/lltimer.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 513de0605d..e0a880a346 100644 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -37,6 +37,7 @@ #include #include // units conversions +#include "llunit.h" #ifndef USEC_PER_SEC const U32 USEC_PER_SEC = 1000000; #endif @@ -55,7 +56,7 @@ public: protected: U64 mLastClockCount; U64 mExpirationTicks; - BOOL mStarted; + bool mStarted; public: LLTimer(); @@ -66,16 +67,16 @@ public: // Return a high precision number of seconds since the start of // this application instance. - static F64 getElapsedSeconds() + static LLUnit::Seconds getElapsedSeconds() { return sTimer->getElapsedTimeF64(); } // Return a high precision usec since epoch - static U64 getTotalTime(); + static LLUnit::Microseconds getTotalTime(); // Return a high precision seconds since epoch - static F64 getTotalSeconds(); + static LLUnit::Seconds getTotalSeconds(); // MANIPULATORS @@ -86,18 +87,18 @@ public: void setTimerExpirySec(F32 expiration); BOOL checkExpirationAndReset(F32 expiration); BOOL hasExpired() const; - F32 getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset - F64 getElapsedTimeAndResetF64(); + LLUnit::Seconds getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset + LLUnit::Seconds getElapsedTimeAndResetF64(); - F32 getRemainingTimeF32() const; + LLUnit::Seconds getRemainingTimeF32() const; static BOOL knownBadTimer(); // ACCESSORS - F32 getElapsedTimeF32() const; // Returns elapsed time in seconds - F64 getElapsedTimeF64() const; // Returns elapsed time in seconds + LLUnit::Seconds getElapsedTimeF32() const; // Returns elapsed time in seconds + LLUnit::Seconds getElapsedTimeF64() const; // Returns elapsed time in seconds - BOOL getStarted() const { return mStarted; } + bool getStarted() const { return mStarted; } static U64 getCurrentClockCount(); // Returns the raw clockticks -- cgit v1.2.3 From 0bb0bd514b235948c1a21c81ab0e8ab6223b1990 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 8 Nov 2012 23:42:18 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct Finished making LLUnit implicitly convertible to/from scalar integer values cleaned up test code --- indra/llcommon/lltimer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index e0a880a346..5cb2b18111 100644 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -67,16 +67,16 @@ public: // Return a high precision number of seconds since the start of // this application instance. - static LLUnit::Seconds getElapsedSeconds() + static LLUnit getElapsedSeconds() { return sTimer->getElapsedTimeF64(); } // Return a high precision usec since epoch - static LLUnit::Microseconds getTotalTime(); + static LLUnit getTotalTime(); // Return a high precision seconds since epoch - static LLUnit::Seconds getTotalSeconds(); + static LLUnit getTotalSeconds(); // MANIPULATORS @@ -87,16 +87,16 @@ public: void setTimerExpirySec(F32 expiration); BOOL checkExpirationAndReset(F32 expiration); BOOL hasExpired() const; - LLUnit::Seconds getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset - LLUnit::Seconds getElapsedTimeAndResetF64(); + LLUnit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset + LLUnit getElapsedTimeAndResetF64(); - LLUnit::Seconds getRemainingTimeF32() const; + LLUnit getRemainingTimeF32() const; static BOOL knownBadTimer(); // ACCESSORS - LLUnit::Seconds getElapsedTimeF32() const; // Returns elapsed time in seconds - LLUnit::Seconds getElapsedTimeF64() const; // Returns elapsed time in seconds + LLUnit getElapsedTimeF32() const; // Returns elapsed time in seconds + LLUnit getElapsedTimeF64() const; // Returns elapsed time in seconds bool getStarted() const { return mStarted; } -- cgit v1.2.3 From c99886d94389babc78e92bbfa5084fdd785915af Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 7 Dec 2012 15:20:12 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system improved unit tests for LLUnit renamed LLUnit to LLUnitImplicit with LLUnit being reserved for explicit units --- indra/llcommon/lltimer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 5cb2b18111..0ba87d1e15 100644 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -67,16 +67,16 @@ public: // Return a high precision number of seconds since the start of // this application instance. - static LLUnit getElapsedSeconds() + static LLUnitImplicit getElapsedSeconds() { return sTimer->getElapsedTimeF64(); } // Return a high precision usec since epoch - static LLUnit getTotalTime(); + static LLUnitImplicit getTotalTime(); // Return a high precision seconds since epoch - static LLUnit getTotalSeconds(); + static LLUnitImplicit getTotalSeconds(); // MANIPULATORS @@ -87,16 +87,16 @@ public: void setTimerExpirySec(F32 expiration); BOOL checkExpirationAndReset(F32 expiration); BOOL hasExpired() const; - LLUnit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset - LLUnit getElapsedTimeAndResetF64(); + LLUnitImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset + LLUnitImplicit getElapsedTimeAndResetF64(); - LLUnit getRemainingTimeF32() const; + LLUnitImplicit getRemainingTimeF32() const; static BOOL knownBadTimer(); // ACCESSORS - LLUnit getElapsedTimeF32() const; // Returns elapsed time in seconds - LLUnit getElapsedTimeF64() const; // Returns elapsed time in seconds + LLUnitImplicit getElapsedTimeF32() const; // Returns elapsed time in seconds + LLUnitImplicit getElapsedTimeF64() const; // Returns elapsed time in seconds bool getStarted() const { return mStarted; } -- cgit v1.2.3