remove some debugging, tweak formatting

This commit is contained in:
Brad Hefta-Gaub 2016-04-21 09:53:00 -07:00
parent ddf5b0f316
commit f9c4959578
3 changed files with 8 additions and 5 deletions

View file

@ -158,7 +158,7 @@ void NodeList::timePingReply(ReceivedMessage& message, const SharedNodePointer&
sendingNode->setPingMs(pingTime / 1000);
sendingNode->updateClockSkewUsec(clockSkew);
const bool wantDebug = true;
const bool wantDebug = false;
if (wantDebug) {
auto averageClockSkew = sendingNode->getClockSkewUsec();

View file

@ -747,7 +747,7 @@ const char* OctreeSceneStats::getItemValue(Item item) {
}
void OctreeSceneStats::trackIncomingOctreePacket(ReceivedMessage& message, bool wasStatsPacket, qint64 nodeClockSkewUsec) {
const bool wantExtraDebugging = true;
const bool wantExtraDebugging = false;
// skip past the flags
message.seek(sizeof(OCTREE_PACKET_FLAGS));

View file

@ -624,9 +624,10 @@ void debug::checkDeadBeef(void* memoryVoid, int size) {
QString formatUsecTime(quint64 usecs, int prec) {
static const quint64 USECS_PER_MINUTE = USECS_PER_SECOND * 60;
static const quint64 USECS_PER_HOUR = USECS_PER_MINUTE * 60;
static const quint64 TWO_HOURS = USECS_PER_HOUR * 2;
QString result;
if (usecs > USECS_PER_HOUR) {
if (usecs > TWO_HOURS) {
result = QString::number(usecs / USECS_PER_HOUR) + "hrs";
} else if (usecs > USECS_PER_MINUTE) {
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_MINUTE = USECS_PER_SECOND * 60;
static const qint64 USECS_PER_HOUR = USECS_PER_MINUTE * 60;
static const qint64 TWO_HOURS = USECS_PER_HOUR * 2;
QString result;
if (usecs > USECS_PER_HOUR) {
if (usecs > TWO_HOURS || usecs < -TWO_HOURS) {
result = QString::number(usecs / USECS_PER_HOUR) + "hrs";
} else if (usecs > USECS_PER_MINUTE || usecs < -USECS_PER_MINUTE) {
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_MINUTE = USECS_PER_SECOND * 60.0;
static const double USECS_PER_HOUR = USECS_PER_MINUTE * 60.0;
static const double TWO_HOURS = USECS_PER_HOUR * 2;
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";
} else if (usecs > USECS_PER_MINUTE || usecs < -USECS_PER_MINUTE) {
result = QString::number(usecs / USECS_PER_MINUTE, 'f', prec) + "min";