IXBench report duration in micro seconds

This commit is contained in:
Benjamin Sergeant 2020-09-28 13:58:12 -07:00
parent 0c877f768a
commit 563ff09667
2 changed files with 5 additions and 5 deletions

View File

@ -33,16 +33,16 @@ namespace ix
void Bench::report()
{
auto now = std::chrono::high_resolution_clock::now();
auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now - _start);
auto microseconds = std::chrono::duration_cast<std::chrono::microseconds>(now - _start);
_ms = milliseconds.count();
std::cerr << _description << " completed in " << _ms << "ms" << std::endl;
_duration = microseconds.count();
std::cerr << _description << " completed in " << _duration << " us" << std::endl;
_reported = true;
}
uint64_t Bench::getDuration() const
{
return _ms;
return _duration;
}
} // namespace ix

View File

@ -24,7 +24,7 @@ namespace ix
private:
std::string _description;
std::chrono::time_point<std::chrono::high_resolution_clock> _start;
uint64_t _ms;
uint64_t _duration;
bool _reported;
};
} // namespace ix