VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
DtScopeTimer Class Reference

This is a simple wrapper around tbb::tick_count timing to be able to easily time a scope of code. Just create one of these on the stack and when it is destroyed it will print the message to the stream (both from the constructor) along with the amount of time the object was alive. Put them in lots of different places and comment them out, then you just have to uncomment one line to check the timing of a section.

Inheritance diagram for DtScopeTimer:
Inheritance graph
[legend]

Public Member Functions

 DtScopeTimer (const std::string &text, std::ostream &str=DtWarn)
 
std::string & text ()
 
 ~DtScopeTimer ()
 

Private Attributes

std::ostream & myStream
 
std::string myText
 
tbb::tick_count myStart
 

Constructor & Destructor Documentation

DtScopeTimer::DtScopeTimer ( const std::string &  text,
std::ostream &  str = DtWarn 
)
inline

Constructor.

Parameters
textMessage to print when done.
strStream to print message to, defaults to DtWarn.
DtScopeTimer::~DtScopeTimer ( )
inline

Member Function Documentation

std::string& DtScopeTimer::text ( )
inline

Member Data Documentation

std::ostream& DtScopeTimer::myStream
private
std::string DtScopeTimer::myText
private
tbb::tick_count DtScopeTimer::myStart
private

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)