MROB
time_profiling.hpp
1 /* Copyright (c) 2022, Gonzalo Ferrer
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  *
16  * time_profiling.hpp
17  *
18  * Created on: Aug 14, 2019
19  * Author: Gonzalo Ferrer
20  */
21 
22 #ifndef TIME_PROFILING_HPP_
23 #define TIME_PROFILING_HPP_
24 
25 #include <chrono>
26 #include <vector>
27 #include <string>
28 
29 
30 namespace mrob {
31 using Ttim = std::chrono::microseconds;
32 
33 
41 {
42 public:
46  TimeProfiling();
54  void reset();
59  void start();
63  void stop(const std::string &key="");
67  void print();
72  double total_time();
73 
74 protected:
75  std::chrono::steady_clock::time_point t1_;
76  std::vector<std::pair<std::string, double>> time_profiles_;
77 };
78 
79 }
80 
81 
82 #endif /* TIME_PROFILING_HPP_ */
void reset()
Definition: time_profiling.cpp:39
TimeProfiling()
Definition: time_profiling.cpp:29
double total_time()
Definition: time_profiling.cpp:68
void stop(const std::string &key="")
Definition: time_profiling.cpp:50
Definition: time_profiling.hpp:40
void start()
Definition: time_profiling.cpp:45
~TimeProfiling()
Definition: time_profiling.cpp:34
Special Euclidean (group) in 3d Is the group representing rotations and translations, that is, rigid body transformations. SE3 = {T = [R t] | R SO3 , t Re^3 } [0 1] Associated to the groups of RBT, there is the Lie algebra se3 representing the same transformation in the tangent space around the identity. Particularly, xi =[w , v] Re^6, where w Re^3 represents the rotation and v the translation. We will preserve this order in this class.
Definition: matrix_base.hpp:36
void print()
Definition: time_profiling.cpp:58