19 auto now = clock::now();
33 using unit = std::chrono::microseconds;
43 min = _d < min ? _d :
min;
44 max = _d > max ? _d :
max;
47 void output(
char const* _name, std::ostream& _os)
49 auto avg = tot /
count;
50 _os << std::setfill(
' ')
51 << std::setw(12) << std::left << _name
52 << std::setw(10) << std::right << std::chrono::duration_cast<unit>(
tot).
count()
53 << std::setw(10) << std::right << std::chrono::duration_cast<unit>(avg).
count()
54 << std::setw(10) << std::right << std::chrono::duration_cast<unit>(
min).
count()
55 << std::setw(10) << std::right << std::chrono::duration_cast<unit>(
max).
count()
60 char const* getExecStateName(
ExecState _state)
83 std::cout <<
" [us] total avg min max\n";
87 for (
auto&& s : stats)
88 agg.update(s->time[i]);
90 agg.output(getExecStateName(
ExecState(i)), std::cout);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
void stateChanged(ExecState _state) override
assert(len-trim+(2 *lenIndices)<=WIDTH)
duration time[(int) ExecState::Finished]