VR-Forces 4.7 Class Documentation
 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. More...

Inheritance diagram for DtScopeTimer:
Inheritance graph
[legend]

Public Member Functions

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

Private Attributes

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

Detailed Description

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.

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 Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)