Merge pull request #7647 from jherico/rate_counter

Fixing rate counter
This commit is contained in:
Brad Hefta-Gaub 2016-04-12 14:48:05 -07:00
commit 88ca5520be

View file

@ -27,6 +27,8 @@ public:
float currentCount = _count;
float intervalSeconds = (float)currentIntervalMs / (float)MSECS_PER_SECOND;
_rate = roundf(currentCount / intervalSeconds * _scale) / _scale;
_start = now;
_count = 0;
};
_count += count;
}