feisty meow concerns codebase  2.140
stopwatch.h File Reference
#include "time_stamp.h"
Include dependency graph for stopwatch.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  timely::stopwatch
 A class for measuring event durations in real time. More...
 

Namespaces

 timely
 #include <time.h>
 

Macros

#define TIME_CHECK_BEGIN
 Logs a warning when an operation takes longer than expected. More...
 
#define TIME_CHECK_END(logger, who, msec_limit, what, filter)
 

Macro Definition Documentation

◆ TIME_CHECK_BEGIN

#define TIME_CHECK_BEGIN
Value:
stopwatch t; \
t.start();

Logs a warning when an operation takes longer than expected.

Place TIME_CHECK_BEGIN before the code that you want to check, then place TIME_CHECK_END afterwards. The two calls must be in the same scope. "logger" should be a reference to a log_base object. [ by Brit Minor ]

Definition at line 79 of file stopwatch.h.

◆ TIME_CHECK_END

#define TIME_CHECK_END (   logger,
  who,
  msec_limit,
  what,
  filter 
)
Value:
{ \
t.halt(); \
if (t.milliseconds() > msec_limit) { \
(logger).log( a_sprintf("TIME_CHECK: %s: %d ms wait for %s.", \
(who), t.milliseconds(), (what)), filter); \
} \
}

Definition at line 82 of file stopwatch.h.