CrystalSpace

Public API Reference

csMeasureTime Class Reference
[Utilities]

Simple helper class to measure execution time of a block. More...

#include <csutil/timemeasure.h>

List of all members.

Public Member Functions

 csMeasureTime (const char *format,...)
 Construct with a formatted description string.
void PrintIntermediate (const char *descr,...)
 Print an intermediate measurement.
 ~csMeasureTime ()

Protected Attributes

csTicks offsetTime
csString text


Detailed Description

Simple helper class to measure execution time of a block.

When destructed, printf()s the time that has passed between construction and destruction in ms.

Use like:
 void Foo (int x)
 {
   csMeasureTime measureFoo ("Foo (%d) time", x);
   
   // ...
 }
This will print the total execution time of Foo().

Definition at line 50 of file timemeasure.h.


Constructor & Destructor Documentation

csMeasureTime::csMeasureTime const char *  format,
  ...
[inline]
 

Construct with a formatted description string.

Definition at line 59 of file timemeasure.h.

References csGetTicks(), csStringBase::FormatV(), offsetTime, and text.


Member Function Documentation

void csMeasureTime::PrintIntermediate const char *  descr,
  ...
[inline]
 

Print an intermediate measurement.

Definition at line 76 of file timemeasure.h.

References csGetTicks(), csPrintf(), csPrintfV(), csStringFast< LEN >::GetData(), offsetTime, and text.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.6