OGS
CPUTime.h
Go to the documentation of this file.
1
15
#pragma once
16
17
#include <ctime>
18
19
namespace
BaseLib
20
{
22
class
CPUTime
23
{
24
public
:
26
void
start
() {
start_time_
= clock(); }
27
29
double
elapsed
()
const
30
{
31
return
(clock() -
start_time_
) /
static_cast<
double
>
(CLOCKS_PER_SEC);
32
}
33
34
private
:
35
double
start_time_
= 0.;
36
};
37
38
}
// end namespace BaseLib
BaseLib::CPUTime
Count CPU time.
Definition
CPUTime.h:23
BaseLib::CPUTime::start
void start()
Start the timer.
Definition
CPUTime.h:26
BaseLib::CPUTime::start_time_
double start_time_
Definition
CPUTime.h:35
BaseLib::CPUTime::elapsed
double elapsed() const
Get the elapsed time after started.
Definition
CPUTime.h:29
BaseLib
Definition
TestDefinition.h:21
BaseLib
CPUTime.h
Generated by
1.11.0