Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Functions
_
a
b
c
d
f
g
i
j
l
m
o
p
q
r
s
t
u
v
Variables
_
a
b
c
d
e
f
g
i
j
l
m
n
p
r
s
u
v
w
Typedefs
c
e
f
i
m
q
r
s
v
Enumerations
Enumerator
Classes
Class List
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
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
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
b
d
e
f
k
l
m
s
t
v
Enumerations
Enumerator
a
b
c
d
e
f
g
i
j
k
m
n
o
p
r
s
t
u
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
Functions
b
c
d
e
f
g
i
l
m
o
p
r
s
t
u
Variables
Typedefs
c
d
e
f
k
r
s
t
Enumerations
Enumerator
Macros
_
a
b
c
d
e
f
i
l
m
n
o
p
r
s
t
v
src
tools
timer.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2010,
3
* François Bleibel,
4
* Olivier Stasse,
5
*
6
* CNRS/AIST
7
*
8
*/
9
10
/* --------------------------------------------------------------------- */
11
/* --- INCLUDE --------------------------------------------------------- */
12
/* --------------------------------------------------------------------- */
13
14
/* SOT */
15
#include <
dynamic-graph/linear-algebra.h
>
16
17
#include <
sot/core/factory.hh
>
18
#include <
sot/core/matrix-geometry.hh
>
19
#include <
sot/core/timer.hh
>
20
21
using namespace
dynamicgraph::sot
;
22
using namespace
dynamicgraph
;
23
24
/* --------------------------------------------------------------------- */
25
/* --- CLASS ----------------------------------------------------------- */
26
/* --------------------------------------------------------------------- */
27
28
typedef
Timer<dynamicgraph::Vector>
timevect
;
29
template
<>
30
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
(
timevect
,
"TimerVector"
);
31
32
typedef
Timer<dynamicgraph::Matrix>
timematrix
;
33
template
<>
34
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
(
timematrix
,
"TimerMatrix"
);
35
36
typedef
Timer<MatrixHomogeneous>
timematrixhomo
;
37
template
<>
38
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
(
timematrixhomo
,
"TimerMatrixHomo"
);
39
40
typedef
Timer<double>
timedouble
;
41
template
<>
42
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
(
timedouble
,
"TimerDouble"
);
43
44
/* --------------------------------------------------------------------- */
45
void
cmdChrono
(
const
std::string &cmdLine, std::istringstream &cmdArg,
46
std::ostream &os) {
47
sotDEBUGIN
(15);
48
49
if
(cmdLine ==
"help"
) {
50
os <<
" - chrono <cmd...>"
51
<<
"\t\t\t\tLaunch <cmd> and display the time spent in the operation."
52
<< std::endl;
53
return
;
54
}
55
56
struct
timeval t0, t1;
57
double
dt
;
58
59
gettimeofday(&t0, NULL);
60
sotDEBUG
(15) <<
"t0: "
<< t0.tv_sec <<
" - "
<< t0.tv_usec << std::endl;
61
62
std::string cmdLine2;
63
cmdArg >> cmdLine2;
64
sotDEBUG
(5) <<
"Chrono <"
<< cmdLine2 <<
">"
<< std::endl;
65
// Florent: remove reference to g_shell
66
// g_shell.cmd(cmdLine2,cmdArg,os);
67
68
gettimeofday(&t1, NULL);
69
dt
= ((
static_cast<
double
>
(t1.tv_sec) -
static_cast<
double
>
(t0.tv_sec)) *
70
1000. +
71
(
static_cast<
double
>
(t1.tv_usec) -
static_cast<
double
>
(t0.tv_usec) +
72
0.) /
73
1000.);
74
sotDEBUG
(15) <<
"t1: "
<< t1.tv_sec <<
" - "
<< t1.tv_usec << std::endl;
75
76
os <<
"Time spent = "
<<
dt
<<
" ms "
<< std::endl;
77
78
sotDEBUGOUT
(15);
79
}
80
81
/* --------------------------------------------------------------------- */
82
/* --- CONTROL --------------------------------------------------------- */
83
/* --------------------------------------------------------------------- */
factory.hh
dynamicgraph
cmdChrono
void cmdChrono(const std::string &cmdLine, std::istringstream &cmdArg, std::ostream &os)
Definition:
timer.cpp:45
timevect
Timer< dynamicgraph::Vector > timevect
Definition:
timer.cpp:28
dynamicgraph::sot::DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
Timer
Definition:
timer.hh:56
timematrixhomo
Timer< MatrixHomogeneous > timematrixhomo
Definition:
timer.cpp:36
sotDEBUGOUT
#define sotDEBUGOUT(level)
Definition:
debug.hh:215
sotDEBUGIN
#define sotDEBUGIN(level)
Definition:
debug.hh:214
timedouble
Timer< double > timedouble
Definition:
timer.cpp:40
linear-algebra.h
timer.hh
matrix-geometry.hh
dynamicgraph::sot
test-parameter-server.dt
float dt
Definition:
test-parameter-server.py:14
timematrix
Timer< dynamicgraph::Matrix > timematrix
Definition:
timer.cpp:32
sotDEBUG
#define sotDEBUG(level)
Definition:
debug.hh:168
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:32