Planeshift
Public Member Functions

ScopedTimer Class Reference

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

#include <psutil.h>

List of all members.

Public Member Functions

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

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: