Bridge++
Ver. 2.0.3
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
d
t
v
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class 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
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
r
s
t
v
w
y
Typedefs
a
b
c
d
e
i
k
l
m
o
p
r
s
t
u
v
Enumerations
Enumerator
c
e
f
g
i
l
m
n
p
r
s
u
v
z
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
f
g
h
i
l
m
n
o
r
s
t
u
y
Variables
Typedefs
a
c
e
f
i
m
o
r
s
t
u
Enumerations
Enumerator
Macros
_
a
b
c
d
e
i
l
n
r
t
u
v
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
timer.h
Go to the documentation of this file.
1
14
#ifndef TIMER_INCLUDED
15
#define TIMER_INCLUDED
16
17
//#define USE_RUSAGE
18
#undef USE_RUSAGE
19
20
#ifdef USE_RUSAGE
21
#include <sys/resource.h>
22
#endif
23
24
#include <cstdio>
25
#include <time.h>
26
#include <sys/time.h>
27
28
#include "
IO/bridgeIO.h
"
29
using
Bridge::vout
;
30
31
class
Timer
32
{
33
public
:
34
static
const
std::string
class_name
;
35
36
public
:
37
Timer
(
const
std::string&
id
=
""
,
const
bool
report
=
false
)
38
:
is_started
(false),
m_start
(0),
m_elapsed
(0),
m_counter
(0),
39
m_id
(id),
40
m_report_on_exit
(
report
)
41
{}
42
43
~Timer
();
44
45
private
:
46
// non-copyable
47
Timer
(
const
Timer
&);
48
Timer
&
operator=
(
const
Timer
&);
49
50
public
:
51
52
void
start
();
53
void
stop
();
54
void
reset
();
55
56
static
void
timestamp
();
57
58
double
elapsed_sec
()
const
;
59
double
elapsed_msec
()
const
;
60
unsigned
long
get_counter
()
const
;
61
62
void
report
(
const
Bridge::VerboseLevel
vl
=
Bridge::GENERAL
);
63
64
private
:
65
bool
is_started
;
66
double
m_start
;
67
68
double
m_elapsed
;
// sec.
69
unsigned
long
m_counter
;
70
71
std::string
m_id
;
72
bool
m_report_on_exit
;
73
};
74
#endif
/* _TIMER_H_ */
Timer::m_elapsed
double m_elapsed
Definition:
timer.h:68
bridgeIO.h
Timer::operator=
Timer & operator=(const Timer &)
Timer::get_counter
unsigned long get_counter() const
Definition:
timer.cpp:121
Bridge::GENERAL
@ GENERAL
Definition:
bridgeIO.h:45
Timer::~Timer
~Timer()
Definition:
timer.cpp:37
Timer::is_started
bool is_started
Definition:
timer.h:65
Timer::m_report_on_exit
bool m_report_on_exit
Definition:
timer.h:72
Timer
Definition:
timer.h:31
Timer::Timer
Timer(const std::string &id="", const bool report=false)
Definition:
timer.h:37
Timer::m_start
double m_start
Definition:
timer.h:66
Timer::start
void start()
Definition:
timer.cpp:44
Timer::m_id
std::string m_id
Definition:
timer.h:71
ParameterCheck::vl
Bridge::VerboseLevel vl
Definition:
parameterCheck.cpp:18
Timer::m_counter
unsigned long m_counter
Definition:
timer.h:69
Timer::timestamp
static void timestamp()
Definition:
timer.cpp:19
Timer::class_name
static const std::string class_name
Definition:
timer.h:34
Timer::elapsed_msec
double elapsed_msec() const
Definition:
timer.cpp:114
Timer::elapsed_sec
double elapsed_sec() const
Definition:
timer.cpp:107
Bridge::VerboseLevel
VerboseLevel
Definition:
bridgeIO.h:42
Timer::stop
void stop()
Definition:
timer.cpp:69
Timer::report
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
Definition:
timer.cpp:128
Bridge::vout
BridgeIO vout
Definition:
bridgeIO.cpp:512
Timer::reset
void reset()
Definition:
timer.cpp:97
src
lib
Tools
timer.h
Generated on Wed Mar 19 2025 11:03:47 for Bridge++ by
1.8.17