libfovis
tictoc.hpp
1 /*
2  * tictoc.hpp
3  *
4  * Created on: May 29, 2009
5  * Author: abachrac
6  */
7 
8 #ifndef __fovis_tictoch_hpp__
9 #define __fovis_tictoch_hpp__
10 
11 #include <inttypes.h>
12 #include <vector>
13 #include <string>
14 
29 namespace fovis
30 {
31 
32 #define FOVIS_TICTOC_ENV "FOVIS_TICTOC"
33 
37 struct tictoc_t
38 {
39  int64_t t;
40  int64_t totalT;
41  int64_t ema;
42  int64_t min;
43  int64_t max;
44  int numCalls;
45  char flag;
46  std::string description;
47 };
48 
54 int64_t
55 tictoc(const char *description);
56 
63 int64_t
64 tictoc_full(const char *description, double ema_alpha, int64_t * ema);
65 
71 typedef enum
72 {
73  TICTOC_AVG,
74  TICTOC_TOTAL,
75  TICTOC_MIN,
76  TICTOC_MAX,
77  TICTOC_EMA,
78  TICTOC_ALPHABETICAL
80 
86 void
88 
92 void
93 tictoc_get_stats(std::vector<tictoc_t> *stats);
94 
99 }
100 
101 #endif
int64_t tictoc(const char *description)
void tictoc_get_stats(std::vector< tictoc_t > *stats)
int64_t tictoc_full(const char *description, double ema_alpha, int64_t *ema)
quick and dirty profiling tool.inspired by the matlab tic/toc command
Definition: camera_intrinsics.hpp:6
tictoc_sort_type_t
Definition: tictoc.hpp:71
void tictoc_print_stats(tictoc_sort_type_t sortType)