batmat main
Batched linear algebra routines
Loading...
Searching...
No Matches
timing.cpp
Go to the documentation of this file.
1#include <batmat/timing.hpp>
2#include <iomanip>
3
4#if !BATMAT_WITH_CPU_TIME
5
6namespace batmat {
7
8std::ostream &operator<<(std::ostream &os, DefaultTimings t) {
9 using millis_f64 = std::chrono::duration<double, std::milli>;
10 auto wall_ms = millis_f64(t.wall_time).count();
11 auto prec = os.precision(6);
12 os << std::setw(8) << wall_ms << " ms (wall) ─ " //
13 << std::setw(8) << "?" << " ms (CPU) ─ " //
14 << std::setprecision(5) << std::setw(7) << "?" << "% ─ " //
15 << std::setw(8) << t.num_invocations << " calls"; //
16 os.precision(prec);
17 return os;
18}
19
20} // namespace batmat
21
22#endif
std::ostream & operator<<(std::ostream &, DefaultTimings)
Definition timing.cpp:8
std::chrono::nanoseconds wall_time
Definition timing.hpp:22
Measures the number of invocations of a specific piece of code and its run time.
Definition timing.hpp:20