Renamed _clocks

This commit is contained in:
Daniel Marjamäki 2018-06-16 22:25:25 +02:00
parent 94c7e28835
commit 4f34a5145f
2 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ void TimerResults::ShowResults(SHOWTIME_MODES mode) const
for (std::vector<dataElementType>::const_iterator iter=data.begin() ; iter!=data.end(); ++iter) { for (std::vector<dataElementType>::const_iterator iter=data.begin() ; iter!=data.end(); ++iter) {
const double sec = iter->second.seconds(); const double sec = iter->second.seconds();
const double secAverage = sec / (double)(iter->second.mNumberOfResults); const double secAverage = sec / (double)(iter->second.mNumberOfResults);
overallData._clocks += iter->second._clocks; overallData.mClocks += iter->second.mClocks;
if ((mode != SHOWTIME_TOP5) || (ordinal<=5)) { if ((mode != SHOWTIME_TOP5) || (ordinal<=5)) {
std::cout << iter->first << ": " << sec << "s (avg. " << secAverage << "s - " << iter->second.mNumberOfResults << " result(s))" << std::endl; std::cout << iter->first << ": " << sec << "s (avg. " << secAverage << "s - " << iter->second.mNumberOfResults << " result(s))" << std::endl;
} }
@ -67,7 +67,7 @@ void TimerResults::ShowResults(SHOWTIME_MODES mode) const
void TimerResults::AddResults(const std::string& str, std::clock_t clocks) void TimerResults::AddResults(const std::string& str, std::clock_t clocks)
{ {
_results[str]._clocks += clocks; _results[str].mClocks += clocks;
_results[str].mNumberOfResults++; _results[str].mNumberOfResults++;
} }

View File

@ -41,16 +41,16 @@ public:
}; };
struct TimerResultsData { struct TimerResultsData {
std::clock_t _clocks; std::clock_t mClocks;
long mNumberOfResults; long mNumberOfResults;
TimerResultsData() TimerResultsData()
: _clocks(0) : mClocks(0)
, mNumberOfResults(0) { , mNumberOfResults(0) {
} }
double seconds() const { double seconds() const {
const double ret = (double)((unsigned long)_clocks) / (double)CLOCKS_PER_SEC; const double ret = (double)((unsigned long)mClocks) / (double)CLOCKS_PER_SEC;
return ret; return ret;
} }
}; };