29 namespace Timings_Details
82 std::ostream&
report(std::ostream& out,
int maxlevel=1000)
const;
122 struct Times const*
start(std::string
const& name);
128 void stop(std::string
const& name);
137 void stop(
struct Times
const* ticket =
nullptr);
149 std::unique_ptr<Times> all;
150 std::stack<Times*> stack;
151 mutable std::mutex mutex;
315 using TimePoint = std::chrono::time_point<std::chrono::high_resolution_clock>;
317 std::vector<std::array<TimePoint,2>> times;
318 std::vector<int> segment;
A scope guard object that automatically closes a timing section on destruction.
Timings & timer()
Returns the used timer.
ScopedTimingSection(ScopedTimingSection const &)=delete
void restart(std::string const &name)
Start new section.
ScopedTimingSection()
Default constructor creating a not-running unnamed section.
bool isRunning() const
Reports whether the section is currently timed.
ScopedTimingSection & operator=(Timings_Details::SectionBeacon const &sec)
Assignment from a beacon.
ScopedTimingSection(std::string const &name, Timings &timer, bool gather=true)
Constructor using provided timer.
ScopedTimingSection(Timings_Details::SectionBeacon const &sec)
Move constructor.
void stop()
Ensures the section is not timed.
void start()
Ensures the section is timed.
ScopedTimingSection(std::string const &name, bool gather=true)
Constructor using the default timer provided by Timings::instance().
A class that gathers data on task timing and provides gnuplot visualization.
void start(int task)
defines the start of given task.
TaskTiming(int nTasks, int m=1)
Constructor.
void stop(int task)
defines the start of given task.
friend std::ostream & operator<<(std::ostream &out, TaskTiming const &tt)
Supports gathering and reporting execution times information for nested program parts.
void clear()
Resets the timer to an empty state.
void stop(struct Times const *ticket=nullptr)
Stops the timing of given section.
static Timings & instance()
Returns a reference to a single default instance.
std::ostream & report(std::ostream &out, int maxlevel=1000) const
Prints a timing report to the given stream.
void stop(std::string const &name)
Stops the timing of given section.
std::ostream & operator<<(std::ostream &out, Timings const &timings)
write a timing report to a stream
Timings_Details::SectionBeacon startSection(std::string const &name)
Provides a beacon to handing over to ScopedTimingSection for starting a section.
struct Times const * start(std::string const &name)
Starts or continues the timing of given section.
std::ostream & operator<<(std::ostream &s, std::vector< Scalar > const &vec)