MySQL 9.1.0
Source Code Documentation
|
A "chronometer" used to clock snippets of code. More...
#include <ut0dbg.h>
Public Member Functions | |
ut_chrono_t (const char *name) | |
Constructor. More... | |
void | reset () |
Resets the chrono (records the current time in it). More... | |
void | show () |
Shows the time elapsed and usage statistics since the last reset. More... | |
void | end () |
Cause the timings not to be printed from the destructor. More... | |
~ut_chrono_t () | |
Destructor. More... | |
Private Attributes | |
const char * | m_name |
Name of this chronometer. More... | |
bool | m_show_from_destructor |
True if the current timings should be printed by the destructor. More... | |
struct rusage | m_ru |
getrusage() result as of the last reset(). More... | |
struct timeval | m_tv |
gettimeofday() result as of the last reset(). More... | |
A "chronometer" used to clock snippets of code.
Example usage: ut_chrono_t ch("this loop"); for (;;) { ... } ch.show(); would print the timings of the for() loop, prefixed with "this loop:"
|
inline |
Constructor.
[in] | name | chrono's name, used when showing the values |
|
inline |
Destructor.
|
inline |
Cause the timings not to be printed from the destructor.
|
inline |
Resets the chrono (records the current time in it).
|
inline |
Shows the time elapsed and usage statistics since the last reset.
|
private |
Name of this chronometer.
|
private |
getrusage() result as of the last reset().
|
private |
True if the current timings should be printed by the destructor.
|
private |
gettimeofday() result as of the last reset().