Browse Source

Subtract call time of system::getTime() itself when measuring Module::process() for meter.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
d017010925
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/engine/Module.cpp

+ 3
- 1
src/engine/Module.cpp View File

@@ -349,7 +349,9 @@ void Module::doProcess(const ProcessArgs& args) {
// Stop CPU timer
if (meterEnabled) {
double endTime = system::getTime();
float duration = endTime - startTime;
// Subtract call time of getTime() itself, since we only want to measure process() time.
double endTime2 = system::getTime();
float duration = (endTime - startTime) - (endTime2 - endTime);

internal->meterSamples++;
internal->meterDurationTotal += duration;


Loading…
Cancel
Save