TexGen
|
Class used to meaure the amount of time it takes to perform a certain task. More...
#include <Timer.h>
Public Member Functions | |
CTimer () | |
void | start (const char *msg=0) |
void | restart (const char *msg=0) |
Turn the timer off and start it again from 0. Print an optional message. More... | |
void | stop (const char *msg=0) |
Stop the timer and print an optional message. More... | |
void | check (const char *msg=0) |
Private Member Functions | |
double | elapsed_time () |
Private Attributes | |
bool | running |
clock_t | start_clock |
time_t | start_time |
double | acc_time |
Friends | |
std::ostream & | operator<< (std::ostream &os, CTimer &t) |
Class used to meaure the amount of time it takes to perform a certain task.
|
inline |
Allow timers to be printed to ostreams using the syntax 'os << t' for an ostream 'os' and a timer 't'. For example, "cout << t" will print out the total amount of time 't' has been "running".
Definition at line 96 of file Timer.h.
References acc_time, elapsed_time(), running, and TGLOG.
Referenced by TexGen::COctreeVoxelMesh::ConvertHexToTets(), TexGen::COctreeVoxelMesh::OutputHexElements(), TexGen::CShearedTextileWeave2D::Refine(), TexGen::CTextileWeave2D::Refine(), TexGen::CVoxelMesh::SaveVoxelMesh(), and TexGen::COctreeVoxelMesh::SaveVoxelMesh().
|
inlineprivate |
Return the total time that the timer has been in the "running" state since it was first "started" or last "restarted". For "short" time periods (less than an hour), the actual cpu time used is reported instead of the elapsed time.
Definition at line 47 of file Timer.h.
References start_clock, and start_time.
|
inline |
Turn the timer off and start it again from 0. Print an optional message.
Definition at line 73 of file Timer.h.
References acc_time, running, start_clock, start_time, and TGLOG.
|
inline |
Start a timer. If it is already running, let it continue running. Print an optional message.
Definition at line 57 of file Timer.h.
References running, start_clock, start_time, and TGLOG.
Referenced by TexGen::COctreeVoxelMesh::ConvertHexToTets(), TexGen::COctreeVoxelMesh::OutputHexElements(), TexGen::CShearedTextileWeave2D::Refine(), TexGen::CTextileWeave2D::Refine(), TexGen::CVoxelMesh::SaveVoxelMesh(), and TexGen::COctreeVoxelMesh::SaveVoxelMesh().
|
inline |
Stop the timer and print an optional message.
Definition at line 86 of file Timer.h.
References acc_time, elapsed_time(), running, and TGLOG.
Referenced by TexGen::COctreeVoxelMesh::ConvertHexToTets(), TexGen::COctreeVoxelMesh::OutputHexElements(), TexGen::CShearedTextileWeave2D::Refine(), TexGen::CTextileWeave2D::Refine(), TexGen::CVoxelMesh::SaveVoxelMesh(), and TexGen::COctreeVoxelMesh::SaveVoxelMesh().
|
friend |
|
private |
|
private |
|
private |
Definition at line 17 of file Timer.h.
Referenced by elapsed_time(), restart(), and start().
|
private |
Definition at line 18 of file Timer.h.
Referenced by elapsed_time(), restart(), and start().