Ring Daemon
Loading...
Searching...
No Matches
jami::debug::Timer Class Reference

Ex: Timer t; std::this_thread::sleep_for(std::chrono::milliseconds(10)); JAMI_LOG("Task took {} ns", t.getDuration<std::chrono::nanoseconds>()); // Timer also automatically prints duration on destruction. More...

#include <debug_utils.h>

Collaboration diagram for jami::debug::Timer:
Collaboration graph

Public Member Functions

template<class Period = std::ratio<1>>
uint64_t getDuration () const
 
void print (std::string_view action) const
 
 Timer (std::string_view name)
 
 ~Timer ()
 

Detailed Description

Ex: Timer t; std::this_thread::sleep_for(std::chrono::milliseconds(10)); JAMI_LOG("Task took {} ns", t.getDuration<std::chrono::nanoseconds>()); // Timer also automatically prints duration on destruction.

Definition at line 48 of file debug_utils.h.

Constructor & Destructor Documentation

◆ Timer()

jami::debug::Timer::Timer ( std::string_view  name)
inline

Definition at line 51 of file debug_utils.h.

◆ ~Timer()

jami::debug::Timer::~Timer ( )
inline

Definition at line 56 of file debug_utils.h.

References jami::emitSignal(), and print().

Here is the call graph for this function:

Member Function Documentation

◆ getDuration()

template<class Period = std::ratio<1>>
uint64_t jami::debug::Timer::getDuration ( ) const
inline

Definition at line 59 of file debug_utils.h.

◆ print()

void jami::debug::Timer::print ( std::string_view  action) const
inline

Definition at line 65 of file debug_utils.h.

References jami::emitSignal(), and JAMI_LOG.

Referenced by ~Timer().

Here is the call graph for this function:

The documentation for this class was generated from the following file: