Planeshift
ScopedTimer Class Reference

Check how long time it take to process a scope. More...

#include <psutil.h>

Public Member Functions

 ScopedTimer (csTicks limit, const char *format,...)
 Start the timer that will print a warning message. More...
 
 ScopedTimer (csTicks limit, ScopedTimerCB *callback)
 Start the timer that will call the callback. More...
 
csTicks TimeUsed () const
 To be used in Callbacks to get time used. More...
 
 ~ScopedTimer ()
 Check the limit and trigger warning if more time used than allowed. More...
 

Detailed Description

Check how long time it take to process a scope.

Used to time processes in the server. Will print or call a function if more then limit ticks is used for a scope.

Definition at line 136 of file psutil.h.

Constructor & Destructor Documentation

ScopedTimer::ScopedTimer ( csTicks  limit,
const char *  format,
  ... 
)

Start the timer that will print a warning message.

Parameters
limitThe maximum number of ticks anticipated for this scope
formatString format of the message to dump
ScopedTimer::ScopedTimer ( csTicks  limit,
ScopedTimerCB callback 
)

Start the timer that will call the callback.

Parameters
limitThe maximum number of ticks anticipated for this scope
callbackThe callback class
ScopedTimer::~ScopedTimer ( )

Check the limit and trigger warning if more time used than allowed.

Member Function Documentation

csTicks ScopedTimer::TimeUsed ( ) const

To be used in Callbacks to get time used.

Returns
Time in ticks

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