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 From 9fd3af3c389ed491b515cbb5136b344b069913e4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 13 Jun 2013 15:29:15 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics changed Units macros and argument order to make it more clear optimized units for integer types fixed merging of periodicrecordings...should eliminate duplicate entries in sceneloadmonitor history --- 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 0ba87d1e15..9e464c4b1a 100755 --- 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 LLUnitImplicit getElapsedSeconds() + static LLUnitImplicit getElapsedSeconds() { return sTimer->getElapsedTimeF64(); } // Return a high precision usec since epoch - static LLUnitImplicit getTotalTime(); + static LLUnitImplicit getTotalTime(); // Return a high precision seconds since epoch - static LLUnitImplicit getTotalSeconds(); + static LLUnitImplicit getTotalSeconds(); // MANIPULATORS @@ -87,16 +87,16 @@ public: void setTimerExpirySec(F32 expiration); BOOL checkExpirationAndReset(F32 expiration); BOOL hasExpired() const; - LLUnitImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset - LLUnitImplicit getElapsedTimeAndResetF64(); + LLUnitImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset + LLUnitImplicit getElapsedTimeAndResetF64(); - LLUnitImplicit getRemainingTimeF32() const; + LLUnitImplicit getRemainingTimeF32() const; static BOOL knownBadTimer(); // ACCESSORS - LLUnitImplicit getElapsedTimeF32() const; // Returns elapsed time in seconds - LLUnitImplicit 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 From 3430444212a14a7f40d8b1afdbefc68c3319562d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 24 Jul 2013 22:41:02 -0700 Subject: BUIDLFIX: forgot to extract value from units object for calling llformat --- indra/llcommon/lltimer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 9e464c4b1a..9f1f243dbb 100755 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -62,14 +62,14 @@ public: LLTimer(); ~LLTimer(); - static void initClass() { if (!sTimer) sTimer = new LLTimer; } - static void cleanupClass() { delete sTimer; sTimer = NULL; } + static void initClass(); + static void cleanupClass(); // Return a high precision number of seconds since the start of // this application instance. static LLUnitImplicit getElapsedSeconds() { - return sTimer->getElapsedTimeF64(); + return sTimer ? sTimer->getElapsedTimeF64() : 0.0; } // Return a high precision usec since epoch -- cgit v1.2.3 From 19f7fb6ccce52224cc067e496d1480191badb165 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 25 Jul 2013 13:48:38 -0700 Subject: BUIDLFIX: bad ternary expression --- indra/llcommon/lltimer.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 9f1f243dbb..f2dc59e405 100755 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -69,7 +69,14 @@ public: // this application instance. static LLUnitImplicit getElapsedSeconds() { - return sTimer ? sTimer->getElapsedTimeF64() : 0.0; + if (sTimer) + { + return sTimer->getElapsedTimeF64(); + } + else + { + return 0; + } } // Return a high precision usec since epoch -- cgit v1.2.3 From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/llcommon/lltimer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index f2dc59e405..1f2c56432b 100755 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -91,7 +91,7 @@ public: void stop() { mStarted = FALSE; } void reset(); // Resets the timer void setLastClockCount(U64 current_count); // Sets the timer so that the next elapsed call will be relative to this time - void setTimerExpirySec(F32 expiration); + void setTimerExpirySec(LLUnitImplicit expiration); BOOL checkExpirationAndReset(F32 expiration); BOOL hasExpired() const; LLUnitImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset @@ -171,6 +171,6 @@ LL_COMMON_API struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_dayli LL_COMMON_API void microsecondsToTimecodeString(U64 current_time, std::string& tcstring); LL_COMMON_API void secondsToTimecodeString(F32 current_time, std::string& tcstring); -U64 LL_COMMON_API totalTime(); // Returns current system time in microseconds +LLUnitImplicit LL_COMMON_API totalTime(); // Returns current system time in microseconds #endif -- cgit v1.2.3 From 612892b45a3413b16e40c49d3bfde77a4ca927fd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 18 Aug 2013 22:30:27 -0700 Subject: SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms continued conversion to units system made units perform type promotion correctly and preserve type in arithmetic e.g. can now do LLVector3 in units added typedefs for remaining common unit types, including implicits --- indra/llcommon/lltimer.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 1f2c56432b..12a453e897 100755 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -67,7 +67,7 @@ public: // Return a high precision number of seconds since the start of // this application instance. - static LLUnitImplicit getElapsedSeconds() + static F64SecondsImplicit getElapsedSeconds() { if (sTimer) { @@ -80,10 +80,10 @@ public: } // Return a high precision usec since epoch - static LLUnitImplicit getTotalTime(); + static U64MicrosecondsImplicit getTotalTime(); // Return a high precision seconds since epoch - static LLUnitImplicit getTotalSeconds(); + static F64SecondsImplicit getTotalSeconds(); // MANIPULATORS @@ -91,19 +91,19 @@ public: void stop() { mStarted = FALSE; } void reset(); // Resets the timer void setLastClockCount(U64 current_count); // Sets the timer so that the next elapsed call will be relative to this time - void setTimerExpirySec(LLUnitImplicit expiration); + void setTimerExpirySec(F32SecondsImplicit expiration); BOOL checkExpirationAndReset(F32 expiration); BOOL hasExpired() const; - LLUnitImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset - LLUnitImplicit getElapsedTimeAndResetF64(); + F32SecondsImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset + F64SecondsImplicit getElapsedTimeAndResetF64(); - LLUnitImplicit getRemainingTimeF32() const; + F32SecondsImplicit getRemainingTimeF32() const; static BOOL knownBadTimer(); // ACCESSORS - LLUnitImplicit getElapsedTimeF32() const; // Returns elapsed time in seconds - LLUnitImplicit getElapsedTimeF64() const; // Returns elapsed time in seconds + F32SecondsImplicit getElapsedTimeF32() const; // Returns elapsed time in seconds + F64SecondsImplicit getElapsedTimeF64() const; // Returns elapsed time in seconds bool getStarted() const { return mStarted; } @@ -171,6 +171,6 @@ LL_COMMON_API struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_dayli LL_COMMON_API void microsecondsToTimecodeString(U64 current_time, std::string& tcstring); LL_COMMON_API void secondsToTimecodeString(F32 current_time, std::string& tcstring); -LLUnitImplicit LL_COMMON_API totalTime(); // Returns current system time in microseconds +U64MicrosecondsImplicit LL_COMMON_API totalTime(); // Returns current system time in microseconds #endif -- cgit v1.2.3 From 2c6bc5afa59a88136fd6de4ebf0cb99ea7cdef3f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 21 Aug 2013 14:06:57 -0700 Subject: SH-4433 WIP Interesting: Statistics > Ping Sim is always 0 ms made getPrimaryAccumulator return a reference since it was an always non-null pointer changed unit conversion to perform lazy division in order to avoid truncation of timer values --- indra/llcommon/lltimer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 12a453e897..8b3930e2fa 100755 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -168,8 +168,8 @@ LL_COMMON_API BOOL is_daylight_savings(); // struct tm* internal_time = utc_to_pacific_time(utc_time, gDaylight); LL_COMMON_API struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time); -LL_COMMON_API void microsecondsToTimecodeString(U64 current_time, std::string& tcstring); -LL_COMMON_API void secondsToTimecodeString(F32 current_time, std::string& tcstring); +LL_COMMON_API void microsecondsToTimecodeString(U64MicrosecondsImplicit current_time, std::string& tcstring); +LL_COMMON_API void secondsToTimecodeString(F32SecondsImplicit current_time, std::string& tcstring); U64MicrosecondsImplicit LL_COMMON_API totalTime(); // Returns current system time in microseconds -- cgit v1.2.3 From a7aed07a5b620977fb74e4070e432eef01d11d3c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Aug 2013 13:41:19 -0700 Subject: broke out llunit.h into llunittype.h and llunits.h for unit declarations changed unit declarations macros to make a lot more sense --- indra/llcommon/lltimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/lltimer.h') diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 8b3930e2fa..4e58102094 100755 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -37,7 +37,7 @@ #include #include // units conversions -#include "llunit.h" +#include "llunits.h" #ifndef USEC_PER_SEC const U32 USEC_PER_SEC = 1000000; #endif -- cgit v1.2.3