OGS
BaseLib::CPUTime Class Reference

Detailed Description

Count CPU time.

Definition at line 22 of file CPUTime.h.

#include <CPUTime.h>

Public Member Functions

void start ()
 Start the timer.
 
double elapsed () const
 Get the elapsed time after started.
 

Private Attributes

double start_time_ = 0.
 

Member Function Documentation

◆ elapsed()

double BaseLib::CPUTime::elapsed ( ) const
inline

Get the elapsed time after started.

Definition at line 29 of file CPUTime.h.

30 {
31 return (clock() - start_time_) / static_cast<double>(CLOCKS_PER_SEC);
32 }
double start_time_
Definition CPUTime.h:35

References start_time_.

Referenced by main().

◆ start()

void BaseLib::CPUTime::start ( )
inline

Start the timer.

Definition at line 26 of file CPUTime.h.

26{ start_time_ = clock(); }

References start_time_.

Referenced by main().

Member Data Documentation

◆ start_time_

double BaseLib::CPUTime::start_time_ = 0.
private

Definition at line 35 of file CPUTime.h.

Referenced by elapsed(), and start().


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