debug cleanup and change to Particle::update() to handle clock skew slightly better

This commit is contained in:
ZappoMan 2013-12-19 10:39:42 -08:00
parent 26366e9fe7
commit 864fc10d3a

View file

@ -424,7 +424,7 @@ bool Particle::encodeParticleEditMessageDetails(PACKET_TYPE command, int count,
void Particle::update() {
uint64_t now = usecTimestampNow();
uint64_t elapsed = now - _lastUpdated;
int elapsed = now - _lastUpdated; // making this signed slightly improves clock skew behavior
float timeElapsed = (float)((float)elapsed/(float)USECS_PER_SECOND);
@ -438,7 +438,7 @@ void Particle::update() {
bool shouldDie = !isInHand && !isStillMoving && isReallyOld;
setShouldDie(shouldDie);
bool wantDebug = false;
const bool wantDebug = false;
if (wantDebug) {
printf("Particle::update()... timeElapsed: %f lifeTime:%f editedAgo:%f "
"isInHand:%s isStillMoveing:%s isReallyOld:%s shouldDie:%s\n",