HepMC3 event record library
Public Member Functions | Private Attributes
Timer Class Reference

Detailed Description

Used to benchmark MC generators.

Definition at line 38 of file Timer.h.

#include <Timer.h>

Public Member Functions

 Timer (const char *name)
 
void start ()
 
int elapsed_time ()
 
int total_time ()
 
void stop ()
 
void reset ()
 
void print ()
 

Private Attributes

const char * m_name
 Name of the object.
 
struct tms m_start
 Start.
 
struct tms m_stop
 Stop.
 
struct tms m_stored
 Stored.
 

Constructor & Destructor Documentation

◆ Timer()

Timer ( const char *  name)
inline

Default constructor

Definition at line 41 of file Timer.h.

References reset().

Member Function Documentation

◆ elapsed_time()

int elapsed_time ( )
inline

Get time elapsed since timer started

Definition at line 49 of file Timer.h.

References m_start, and m_stop.

◆ print()

void print ( )
inline

Print time elapsed

Definition at line 82 of file Timer.h.

References m_name, and m_stored.

◆ reset()

void reset ( )
inline

Reset the clock

Definition at line 74 of file Timer.h.

References m_start, and m_stored.

◆ start()

void start ( )
inline

Start or restart the timer

Definition at line 44 of file Timer.h.

References m_start.

◆ stop()

void stop ( )
inline

Save end time and aggregate build-in clock

Definition at line 60 of file Timer.h.

References m_start, m_stop, and m_stored.

◆ total_time()

int total_time ( )
inline

Get total time counted by the timer

Definition at line 55 of file Timer.h.

References m_stored.

Field Documentation

◆ m_name

const char* m_name
private

Name of the object.

Definition at line 89 of file Timer.h.

◆ m_start

struct tms m_start
private

Start.

Definition at line 90 of file Timer.h.

◆ m_stop

struct tms m_stop
private

Stop.

Definition at line 91 of file Timer.h.

◆ m_stored

struct tms m_stored
private

Stored.

Definition at line 92 of file Timer.h.


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