mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
use floating point for game loop stats values
This commit is contained in:
parent
21cd986645
commit
773c48bbc9
1 changed files with 2 additions and 2 deletions
|
@ -474,7 +474,7 @@ void Stats::updateStats(bool force) {
|
||||||
std::priority_queue<SortableStat> idleUpdateStats;
|
std::priority_queue<SortableStat> idleUpdateStats;
|
||||||
auto itr = allRecords.find("/idle/update");
|
auto itr = allRecords.find("/idle/update");
|
||||||
if (itr != allRecords.end()) {
|
if (itr != allRecords.end()) {
|
||||||
uint64_t dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||||
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
|
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
|
||||||
|
|
||||||
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "misc" };
|
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "misc" };
|
||||||
|
@ -482,7 +482,7 @@ void Stats::updateStats(bool force) {
|
||||||
QString recordKey = "/idle/update/" + categories[j];
|
QString recordKey = "/idle/update/" + categories[j];
|
||||||
itr = allRecords.find(recordKey);
|
itr = allRecords.find(recordKey);
|
||||||
if (itr != allRecords.end()) {
|
if (itr != allRecords.end()) {
|
||||||
uint64_t dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||||
QString message = QString("\n %1 = %2").arg(categories[j]).arg(dt);
|
QString message = QString("\n %1 = %2").arg(categories[j]).arg(dt);
|
||||||
idleUpdateStats.push(SortableStat(message, dt));
|
idleUpdateStats.push(SortableStat(message, dt));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue