Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Tools/Debugging/Stopwatch.h File Reference

Makros and for the Stopwatch. More...

`#include "Tools/Debugging/Debugging.h"`
`#include "Platform/SystemCall.h"`
`#include "Platform/GTAssert.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 | Stopwatch
| Provides IDs and names for different stopwatch tasks; makros are used to provide real stopwatch functionality with that. More...
## Defines
#define | NSTOP_TIME_ON_REQUEST(eventID, expression)
#define | NSTOP_TIME(expression)
#define | STOP_TIME_ON_REQUEST(eventID, expression)
| Stops the execution time of "expression" if a DebugKey is set for the eventID.
#define | STOP_TIME(expression)
| Starts a StopWatch without an id.

## Detailed Description

Makros and for the Stopwatch.

Author:
  Matthias Jüngel

Definition in file Stopwatch.h.

## Define Documentation

#define NSTOP_TIME_ON_REQUEST | ( | eventID,
|  | expression |  | ) |

| Definition at line 102 of file Stopwatch.h. Referenced by Cognition::main().

#define NSTOP_TIME | ( | expression |  | ) |

| Definition at line 103 of file Stopwatch.h.

#define STOP_TIME_ON_REQUEST | ( | eventID,
|  | expression |  | ) |

| Value:
    if (getDebugKeyTable().isActive(Stopwatch::getDebugKeyID(Stopwatch::eventID))) \
    {\
      unsigned long eventID##StartTime; \
      static unsigned long evendID##Counter = 0; \
      eventID##StartTime = SystemCall::getCurrentSystemTime();\
      expression \
      OUTPUT(idStopwatch, bin, (char) Stopwatch::eventID << eventID##StartTime << SystemCall::getCurrentSystemTime() << evendID##Counter++)\
    }\
      else {expression}\
Stops the execution time of "expression" if a DebugKey is set for the eventID. The start and stop times are sent as a idStopwatch message to RobotControl Definition at line 117 of file Stopwatch.h. Referenced by Cognition::main().

#define STOP_TIME | ( | expression |  | ) |

| Value:
    {\
      unsigned long stopwatchStartTime = SystemCall::getCurrentSystemTime();\
      expression\
      OUTPUT(idText, text, "Stopwatch: " << SystemCall::getTimeSince(stopwatchStartTime) << "ms")\
    }\
Starts a StopWatch without an id. Definition at line 132 of file Stopwatch.h.