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

# Tools/Debugging/Stopwatch2.h

Go to the documentation of this file.

    00001 /**
    00002 * @file Stopwatch2.h
    00003 * stopwatch macros
    00004 *
    00005 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00006 */
    00007
    00008 #ifndef __Stopwatch2_h_
    00009 #define __Stopwatch2_h_
    00010
    00011 #include "Tools/Debugging/Debugging.h"
    00012 #include "Platform/SystemCall.h"
    00013 #include "Platform/GTAssert.h"
    00014
    00015 class Stopwatch
    00016 {
    00017 public:
    00018   enum StopwatchEventID
    00019   {
    00020     numberOfStopwatchEventIDs = 100
    00021   };
    00022
    00023   static const char* getStopwatchEventIDName(enum StopwatchEventID stopwatchEventID)
    00024   {
    00025     return("please use RobotControl2 or another 'next generation' debug tool.");
    00026   }
    00027
    00028 };
    00029
    00030 #define STOP_TIME_ON_REQUEST(eventID, expression)
    00031 #define STOP_TIME(expression)
    00032
    00033 #ifdef NDEBUG
    00034
    00035 #define NSTOP_TIME_ON_REQUEST(eventID, expression) expression
    00036 #define NSTOP_TIME(expression) expression/**/
    00037
    00038 #else //NDEBUG
    00039
    00040 #define NSTOP_TIME_ON_REQUEST(eventID, expression) \
    00041   DEBUG_RESPONSE("stopwatch:" #eventID, \
    00042   unsigned long eventID##StartTimeN; \
    00043   static unsigned long eventID##Counter = 0; \
    00044   eventID##StartTimeN = SystemCall::getCurrentSystemTime();\
    00045   expression \
    00046   OUTPUT(idStopwatch, bin, #eventID << eventID##StartTimeN << SystemCall::getCurrentSystemTime() << eventID##Counter++) \
    00047   ); \
    00048   DEBUG_RESPONSE_NOT("stopwatch:" #eventID, expression );
    00049 #endif //NDEBUG
    00050
    00051 #endif //Stopwatch2_h
    00052
    00053
    00054
    00055
    00056
    00057
    00058
    00059
    00060
    00061
    00062