Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
loostrum committed Nov 15, 2024
1 parent a54e90c commit 6e48bd4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions host/src/PowerSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ double elapsedSeconds(const std::chrono::time_point<std::chrono::high_resolution
const std::chrono::time_point<std::chrono::high_resolution_clock> &tend) {
return std::chrono::duration_cast<std::chrono::seconds>(tend - tstart).count();
}
}
} // namespace


namespace PowerSensor3 {
Expand Down Expand Up @@ -364,7 +364,8 @@ void PowerSensor::writeMarker() {
void PowerSensor::mark(const State &startState, const State &stopState, std::string name, unsigned int tag) const {
if (dumpFile != nullptr) {
std::unique_lock<std::mutex> lock(dumpFileMutex);
*dumpFile << "M " << elapsedSeconds(startTime, startState.timeAtRead) << ' ' << elapsedSeconds(startTime, stopState.timeAtRead) << ' ' \
*dumpFile << "M " << elapsedSeconds(startTime, startState.timeAtRead) << ' ' \
<< elapsedSeconds(startTime, stopState.timeAtRead) << ' ' \
<< tag << " \"" << name << '"' << std::endl;
}
}
Expand Down Expand Up @@ -497,7 +498,8 @@ void PowerSensor::updateSensorPairs() {
sensorPair.currentAtLastMeasurement = currentSensor.valueAtLastMeasurement;
sensorPair.voltageAtLastMeasurement = voltageSensor.valueAtLastMeasurement;
sensorPair.wattAtLastMeasurement = currentSensor.valueAtLastMeasurement * voltageSensor.valueAtLastMeasurement;
sensorPair.consumedEnergy += sensorPair.wattAtLastMeasurement * elapsedSeconds(sensorPair.timeAtLastMeasurement, now);
sensorPair.consumedEnergy += sensorPair.wattAtLastMeasurement *
elapsedSeconds(sensorPair.timeAtLastMeasurement, now);
sensorPair.timeAtLastMeasurement = now;
}
}
Expand Down

0 comments on commit 6e48bd4

Please sign in to comment.