mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
remove some debugging, tweak formatting
This commit is contained in:
parent
ddf5b0f316
commit
f9c4959578
3 changed files with 8 additions and 5 deletions
|
@ -158,7 +158,7 @@ void NodeList::timePingReply(ReceivedMessage& message, const SharedNodePointer&
|
||||||
sendingNode->setPingMs(pingTime / 1000);
|
sendingNode->setPingMs(pingTime / 1000);
|
||||||
sendingNode->updateClockSkewUsec(clockSkew);
|
sendingNode->updateClockSkewUsec(clockSkew);
|
||||||
|
|
||||||
const bool wantDebug = true;
|
const bool wantDebug = false;
|
||||||
|
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
auto averageClockSkew = sendingNode->getClockSkewUsec();
|
auto averageClockSkew = sendingNode->getClockSkewUsec();
|
||||||
|
|
|
@ -747,7 +747,7 @@ const char* OctreeSceneStats::getItemValue(Item item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OctreeSceneStats::trackIncomingOctreePacket(ReceivedMessage& message, bool wasStatsPacket, qint64 nodeClockSkewUsec) {
|
void OctreeSceneStats::trackIncomingOctreePacket(ReceivedMessage& message, bool wasStatsPacket, qint64 nodeClockSkewUsec) {
|
||||||
const bool wantExtraDebugging = true;
|
const bool wantExtraDebugging = false;
|
||||||
|
|
||||||
// skip past the flags
|
// skip past the flags
|
||||||
message.seek(sizeof(OCTREE_PACKET_FLAGS));
|
message.seek(sizeof(OCTREE_PACKET_FLAGS));
|
||||||
|
|
|
@ -624,9 +624,10 @@ void debug::checkDeadBeef(void* memoryVoid, int size) {
|
||||||
QString formatUsecTime(quint64 usecs, int prec) {
|
QString formatUsecTime(quint64 usecs, int prec) {
|
||||||
static const quint64 USECS_PER_MINUTE = USECS_PER_SECOND * 60;
|
static const quint64 USECS_PER_MINUTE = USECS_PER_SECOND * 60;
|
||||||
static const quint64 USECS_PER_HOUR = USECS_PER_MINUTE * 60;
|
static const quint64 USECS_PER_HOUR = USECS_PER_MINUTE * 60;
|
||||||
|
static const quint64 TWO_HOURS = USECS_PER_HOUR * 2;
|
||||||
|
|
||||||
QString result;
|
QString result;
|
||||||
if (usecs > USECS_PER_HOUR) {
|
if (usecs > TWO_HOURS) {
|
||||||
result = QString::number(usecs / USECS_PER_HOUR) + "hrs";
|
result = QString::number(usecs / USECS_PER_HOUR) + "hrs";
|
||||||
} else if (usecs > USECS_PER_MINUTE) {
|
} else if (usecs > USECS_PER_MINUTE) {
|
||||||
result = QString::number(usecs / USECS_PER_MINUTE) + "min";
|
result = QString::number(usecs / USECS_PER_MINUTE) + "min";
|
||||||
|
@ -645,8 +646,9 @@ QString formatUsecTime(qint64 usecs, int prec) {
|
||||||
static const qint64 USECS_PER_SECOND = 1000 * USECS_PER_MSEC;
|
static const qint64 USECS_PER_SECOND = 1000 * USECS_PER_MSEC;
|
||||||
static const qint64 USECS_PER_MINUTE = USECS_PER_SECOND * 60;
|
static const qint64 USECS_PER_MINUTE = USECS_PER_SECOND * 60;
|
||||||
static const qint64 USECS_PER_HOUR = USECS_PER_MINUTE * 60;
|
static const qint64 USECS_PER_HOUR = USECS_PER_MINUTE * 60;
|
||||||
|
static const qint64 TWO_HOURS = USECS_PER_HOUR * 2;
|
||||||
QString result;
|
QString result;
|
||||||
if (usecs > USECS_PER_HOUR) {
|
if (usecs > TWO_HOURS || usecs < -TWO_HOURS) {
|
||||||
result = QString::number(usecs / USECS_PER_HOUR) + "hrs";
|
result = QString::number(usecs / USECS_PER_HOUR) + "hrs";
|
||||||
} else if (usecs > USECS_PER_MINUTE || usecs < -USECS_PER_MINUTE) {
|
} else if (usecs > USECS_PER_MINUTE || usecs < -USECS_PER_MINUTE) {
|
||||||
result = QString::number(usecs / USECS_PER_MINUTE) + "min";
|
result = QString::number(usecs / USECS_PER_MINUTE) + "min";
|
||||||
|
@ -669,8 +671,9 @@ QString formatUsecTime(double usecs, int prec) {
|
||||||
static const double USECS_PER_SECOND = 1000.0 * USECS_PER_MSEC;
|
static const double USECS_PER_SECOND = 1000.0 * USECS_PER_MSEC;
|
||||||
static const double USECS_PER_MINUTE = USECS_PER_SECOND * 60.0;
|
static const double USECS_PER_MINUTE = USECS_PER_SECOND * 60.0;
|
||||||
static const double USECS_PER_HOUR = USECS_PER_MINUTE * 60.0;
|
static const double USECS_PER_HOUR = USECS_PER_MINUTE * 60.0;
|
||||||
|
static const double TWO_HOURS = USECS_PER_HOUR * 2;
|
||||||
QString result;
|
QString result;
|
||||||
if (usecs > USECS_PER_HOUR || usecs < -USECS_PER_HOUR) {
|
if (usecs > TWO_HOURS || usecs < -TWO_HOURS) {
|
||||||
result = QString::number(usecs / USECS_PER_HOUR, 'f', prec) + "hrs";
|
result = QString::number(usecs / USECS_PER_HOUR, 'f', prec) + "hrs";
|
||||||
} else if (usecs > USECS_PER_MINUTE || usecs < -USECS_PER_MINUTE) {
|
} else if (usecs > USECS_PER_MINUTE || usecs < -USECS_PER_MINUTE) {
|
||||||
result = QString::number(usecs / USECS_PER_MINUTE, 'f', prec) + "min";
|
result = QString::number(usecs / USECS_PER_MINUTE, 'f', prec) + "min";
|
||||||
|
|
Loading…
Reference in a new issue