ws gzip / add way to run command N time for benchmarking

This commit is contained in:
Benjamin Sergeant
2020-09-28 18:41:57 -07:00
parent fc9a014195
commit bdadfcba19
3 changed files with 33 additions and 3 deletions

View File

@ -38,6 +38,19 @@ namespace ix
_duration = microseconds.count();
std::cerr << _description << " completed in " << _duration << " us" << std::endl;
setReported();
}
void Bench::record()
{
auto now = std::chrono::high_resolution_clock::now();
auto microseconds = std::chrono::duration_cast<std::chrono::microseconds>(now - _start);
_duration = microseconds.count();
}
void Bench::setReported()
{
_reported = true;
}

View File

@ -18,7 +18,9 @@ namespace ix
~Bench();
void reset();
void record();
void report();
void setReported();
uint64_t getDuration() const;
private: