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() void Bench::report()
{ {
auto now = std::chrono::high_resolution_clock::now(); 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(); _duration = microseconds.count();
std::cerr << _description << " completed in " << _ms << "ms" << std::endl; std::cerr << _description << " completed in " << _duration << " us" << std::endl;
_reported = true; _reported = true;
} }
uint64_t Bench::getDuration() const uint64_t Bench::getDuration() const
{ {
return _ms; return _duration;
} }
} // namespace ix } // namespace ix

View File

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