-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeAnalyze.hpp
74 lines (52 loc) · 1.36 KB
/
TimeAnalyze.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// TimeAnalyze.hpp
// Advance_Lane_Detection_640_480
//
// Created by Yakup Gorur on 3/7/18.
// Copyright © 2018 Yakup Gorur. All rights reserved.
//
#ifndef TimeAnalyze_hpp
#define TimeAnalyze_hpp
#include <stdio.h>
#include <iostream>
using namespace std;
class TimeAnalyze
{
private:
//starting point of time
clock_t clk_start;
//Total duration
clock_t clk_total = 0;
//duration of one lap
clock_t clk_duration = 0;
//maximum time in frames
clock_t clk_maxtime = 0;
//minumum time in frames
clock_t clk_mintime = 100 * (double)CLOCKS_PER_SEC;
//frame counter
int framecounter = 0;
//Analyze name
string name;
bool debug;
public:
//Default Constructor
TimeAnalyze(string _analyze_name, bool _debug, bool start = false);
/**
* @brief Start Clock
*/
void Start();
/**
* @brief Stop Clock, Calculate duration, Add duration in Total duration
* and Control Max Min duration
*/
void Stop();
/**
* @brief Reset the staring point, ending point, frame counter, max_time and min_time
*/
void Reset();
/**
* @brief Calculate the timing analyze. And print total time, frame number, maximum time and minum time.
*/
void Print();
};
#endif /* TimeAnalyze_hpp */