NeoPZ
Public Member Functions | Private Attributes | Friends | List of all members
TPZTimer Class Reference

The timer class. Utility. More...

#include <TPZTimer.h>

Collaboration diagram for TPZTimer:
[legend]

Public Member Functions

 TPZTimer ()
 
 TPZTimer (std::string pn)
 Default constructor. More...
 
 ~TPZTimer ()
 Default Destructor. More...
 
std::string & processName ()
 Gets the process name (for reporting purposes). More...
 
const std::string & processName () const
 Gets the process name (for reporting purposes). More...
 
void start ()
 Turns the timer on. More...
 
void stop ()
 Turns the timer off, and computes the elapsed time. More...
 
void reset ()
 Zeroes the timer. More...
 
double seconds () const
 Returns the elapsed time in seconds. More...
 

Private Attributes

PZResourceUsage resources
 Information on the resources used. More...
 
double AccumSec
 Total accumulated time in seconds. More...
 
std::string ProcessName
 Name of the process being timed. More...
 

Friends

std::ostream & operator<< (std::ostream &Out, const TPZTimer &t)
 Prints the time nicely formated. More...
 

Detailed Description

The timer class. Utility.

Author
Cantao!
Warning
Check its behavior on non-GNU systems. The purpose of this class is to provide a simple, mono-threaded timer. It is based entirely on GNU timer, so I don't know its behavior on non-GNU systems.

Definition at line 46 of file TPZTimer.h.

Member Function Documentation

◆ start()

void TPZTimer::start ( )

◆ stop()

void TPZTimer::stop ( )

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  Out,
const TPZTimer t 
)
friend

Prints the time nicely formated.

Definition at line 48 of file TPZTimer.cpp.

Member Data Documentation

◆ AccumSec

double TPZTimer::AccumSec
private

Total accumulated time in seconds.

Definition at line 88 of file TPZTimer.h.

Referenced by operator<<(), reset(), seconds(), and stop().

◆ ProcessName

std::string TPZTimer::ProcessName
private

Name of the process being timed.

Definition at line 91 of file TPZTimer.h.

Referenced by processName().

◆ resources

PZResourceUsage TPZTimer::resources
private

Information on the resources used.

Definition at line 85 of file TPZTimer.h.

Referenced by start(), and stop().


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