summaryrefslogtreecommitdiff
path: root/indra/newview/llperfstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llperfstats.cpp')
-rw-r--r--indra/newview/llperfstats.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp
index 1a0e5842e2..3bf88bb2a6 100644
--- a/indra/newview/llperfstats.cpp
+++ b/indra/newview/llperfstats.cpp
@@ -43,6 +43,8 @@ namespace LLPerfStats
U32 lastGlobalPrefChange{0};
std::mutex bufferToggleLock{};
+ F64 cpu_hertz{0.0};
+
Tunables tunables;
std::atomic<int> StatsRecorder::writeBuffer{0};
@@ -126,6 +128,8 @@ namespace LLPerfStats
// create a queue
// create a thread to consume from the queue
tunables.initialiseFromSettings();
+ LLPerfStats::cpu_hertz = (F64)LLTrace::BlockTimer::countsPerSecond();
+
t.detach();
}
@@ -332,7 +336,7 @@ namespace LLPerfStats
}
// The frametime budget we have based on the target FPS selected
- auto target_frame_time_raw = (U64)llround((F64)LLTrace::BlockTimer::countsPerSecond()/(tunables.userTargetFPS==0?1:tunables.userTargetFPS));
+ auto target_frame_time_raw = (U64)llround(LLPerfStats::cpu_hertz/(tunables.userTargetFPS==0?1:tunables.userTargetFPS));
// LL_INFOS() << "Effective FPS(raw):" << tot_frame_time_raw << " Target:" << target_frame_time_raw << LL_ENDL;
auto inferredFPS{1000/(U32)std::max(raw_to_ms(tot_frame_time_raw),1.0)};
U32 settingsChangeFrequency{inferredFPS > 25?inferredFPS:25};