diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llcommon/lltimer.cpp | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/llcommon/lltimer.cpp')
-rw-r--r-- | linden/indra/llcommon/lltimer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/linden/indra/llcommon/lltimer.cpp b/linden/indra/llcommon/lltimer.cpp index 21fbf0e..6077063 100644 --- a/linden/indra/llcommon/lltimer.cpp +++ b/linden/indra/llcommon/lltimer.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | # include <winsock2.h> | 37 | # include <winsock2.h> |
38 | # include <windows.h> | 38 | # include <windows.h> |
39 | # include <time.h> | 39 | # include <time.h> |
40 | #elif LL_LINUX | 40 | #elif LL_LINUX || LL_SOLARIS |
41 | # include <time.h> | 41 | # include <time.h> |
42 | # include <sys/time.h> | 42 | # include <sys/time.h> |
43 | # include <sched.h> | 43 | # include <sched.h> |
@@ -90,7 +90,7 @@ void llyield() | |||
90 | { | 90 | { |
91 | SleepEx(0, TRUE); // Relinquishes time slice to any thread of equal priority, can be woken up by extended IO functions | 91 | SleepEx(0, TRUE); // Relinquishes time slice to any thread of equal priority, can be woken up by extended IO functions |
92 | } | 92 | } |
93 | #elif LL_LINUX | 93 | #elif LL_LINUX || LL_SOLARIS |
94 | void ms_sleep(long ms) | 94 | void ms_sleep(long ms) |
95 | { | 95 | { |
96 | struct timespec t; | 96 | struct timespec t; |
@@ -150,7 +150,7 @@ F64 calc_clock_frequency(U32 uiMeasureMSecs) | |||
150 | #endif // LL_WINDOWS | 150 | #endif // LL_WINDOWS |
151 | 151 | ||
152 | 152 | ||
153 | #if LL_LINUX || LL_DARWIN | 153 | #if LL_LINUX || LL_DARWIN || LL_SOLARIS |
154 | // Both Linux and Mac use gettimeofday for accurate time | 154 | // Both Linux and Mac use gettimeofday for accurate time |
155 | F64 calc_clock_frequency(unsigned int uiMeasureMSecs) | 155 | F64 calc_clock_frequency(unsigned int uiMeasureMSecs) |
156 | { | 156 | { |
@@ -169,7 +169,7 @@ U64 get_clock_count() | |||
169 | 169 | ||
170 | void update_clock_frequencies() | 170 | void update_clock_frequencies() |
171 | { | 171 | { |
172 | gClockFrequency = calc_clock_frequency(50); | 172 | gClockFrequency = calc_clock_frequency(50U); |
173 | gClockFrequencyInv = 1.0/gClockFrequency; | 173 | gClockFrequencyInv = 1.0/gClockFrequency; |
174 | gClocksToMicroseconds = gClockFrequencyInv * SEC_TO_MICROSEC; | 174 | gClocksToMicroseconds = gClockFrequencyInv * SEC_TO_MICROSEC; |
175 | } | 175 | } |
@@ -512,7 +512,7 @@ void secondsToTimecodeString(F32 current_time, char *tcstring) | |||
512 | std::list<LLEventTimer*> LLEventTimer::sActiveList; | 512 | std::list<LLEventTimer*> LLEventTimer::sActiveList; |
513 | 513 | ||
514 | LLEventTimer::LLEventTimer(F32 period) | 514 | LLEventTimer::LLEventTimer(F32 period) |
515 | : mTimer() | 515 | : mEventTimer() |
516 | { | 516 | { |
517 | mPeriod = period; | 517 | mPeriod = period; |
518 | sActiveList.push_back(this); | 518 | sActiveList.push_back(this); |
@@ -528,9 +528,9 @@ void LLEventTimer::updateClass() | |||
528 | for (std::list<LLEventTimer*>::iterator iter = sActiveList.begin(); iter != sActiveList.end(); ) | 528 | for (std::list<LLEventTimer*>::iterator iter = sActiveList.begin(); iter != sActiveList.end(); ) |
529 | { | 529 | { |
530 | LLEventTimer* timer = *iter++; | 530 | LLEventTimer* timer = *iter++; |
531 | F32 et = timer->mTimer.getElapsedTimeF32(); | 531 | F32 et = timer->mEventTimer.getElapsedTimeF32(); |
532 | if (et > timer->mPeriod) { | 532 | if (et > timer->mPeriod) { |
533 | timer->mTimer.reset(); | 533 | timer->mEventTimer.reset(); |
534 | timer->tick(); | 534 | timer->tick(); |
535 | } | 535 | } |
536 | } | 536 | } |