OGS
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
z
Enumerations
b
c
d
e
f
g
i
l
m
n
o
p
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
l
m
n
p
r
s
t
v
y
Classes
Class List
Class Index
Class Hierarchy
Files
File List
File Members
All
a
b
c
d
e
f
g
i
k
m
n
o
p
r
s
t
v
w
x
Functions
a
c
d
e
f
g
i
m
o
p
r
s
t
v
w
Variables
Typedefs
Enumerations
Macros
b
c
g
m
n
o
p
r
s
t
▼
OGS
►
OpenGeoSys 6.5.4-301-gee1fb4d5 source code documentation
►
OGS CTests—Project Files
►
OGS Input File Parameters—Quality Assurance
►
OGS Input File Parameters
BulkMappingDocuPage
Todo List
OGS Input File Parameters—List of incomplete documentation pages
Bibliography
►
Namespaces
►
Classes
▼
Files
▼
File List
►
Applications
▼
BaseLib
►
IO
►
Algorithm.h
►
BoostMP11Utils.h
►
CompilerWorkarounds.h
ConfigTree-fwd.h
►
ConfigTree-impl.h
►
ConfigTree.cpp
►
ConfigTree.h
►
ConfigTreeUtil.cpp
►
ConfigTreeUtil.h
►
ContainerTools.h
►
cpp23.h
►
CPUTime.h
►
DateTools.cpp
►
DateTools.h
►
DisableFPE.h
►
Error.h
►
ExportSymbol.h
►
FileTools.cpp
►
FileTools.h
►
Histogram.cpp
►
Histogram.h
►
Logging.cpp
►
Logging.h
MemWatch.cpp
►
MemWatch.h
►
MPI.h
►
PrjProcessing.cpp
►
PrjProcessing.h
►
quicksort.h
►
RunTime.h
►
StringTools.cpp
►
StringTools.h
►
StrongType.h
Subdivision.cpp
►
Subdivision.h
►
ThreadException.h
►
TimeInterval.cpp
►
TimeInterval.h
►
TMP.h
►
build
►
ChemistryLib
Documentation
►
GeoLib
►
InfoLib
►
MaterialLib
►
MathLib
►
MeshGeoToolsLib
►
MeshLib
►
MeshToolsLib
►
NumLib
►
ParameterLib
►
ProcessLib
►
File Members
RunTime.h
Go to the documentation of this file.
1
15
#pragma once
16
17
#ifdef USE_PETSC
18
#include <mpi.h>
19
20
#include <limits>
21
#else
22
#include <chrono>
23
#endif
24
25
namespace
BaseLib
26
{
28
class
RunTime
29
{
30
public
:
32
void
start
()
33
{
34
#ifdef USE_PETSC
35
start_time_
= MPI_Wtime();
36
#else
37
start_time_
= std::chrono::system_clock::now();
38
#endif
39
}
32
void
start
() {
…
}
40
42
double
elapsed
()
const
43
{
44
#ifdef USE_PETSC
45
return
MPI_Wtime() -
start_time_
;
46
#else
47
using namespace
std::chrono;
48
return
duration<double>(system_clock::now() -
start_time_
).count();
49
#endif
50
}
42
double
elapsed
()
const
{
…
}
51
52
private
:
53
#ifdef USE_PETSC
54
double
start_time_
= std::numeric_limits<double>::quiet_NaN();
55
#else
56
std::chrono::time_point<std::chrono::system_clock>
start_time_
;
57
#endif
58
};
28
class
RunTime
{
…
};
59
60
}
// end namespace BaseLib
BaseLib::RunTime
Count the running time.
Definition
RunTime.h:29
BaseLib::RunTime::elapsed
double elapsed() const
Get the elapsed time in seconds.
Definition
RunTime.h:42
BaseLib::RunTime::start_time_
double start_time_
Definition
RunTime.h:54
BaseLib::RunTime::start
void start()
Start the timer.
Definition
RunTime.h:32
BaseLib
Definition
TestDefinition.h:21
BaseLib
RunTime.h
Generated by
1.12.0