comparison include/intervals.h @ 42:24af9a14b203 ultra-staging

Included timer files
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 19 May 2015 16:42:38 +0100
parents
children
comparison
equal deleted inserted replaced
41:4255ecbb9bec 42:24af9a14b203
1 /*
2 * intervals.h
3 *
4 * Created on: 18 May 2015
5 * Author: unmanaged
6 */
7
8 #ifndef INTERVALS_H_
9 #define INTERVALS_H_
10
11 #define TEN_POW_9 1000000000
12
13 #include <unistd.h>
14 #include <stdio.h>
15 #include <stdlib.h>
16
17 #include <native/timer.h>
18 #include <rtdk.h>
19
20 class Interval
21 {
22 private:
23 int intervalsPointer;
24 long sum;
25 RTIME startTime;
26 RTIME *intervals;
27 float maxTimeus;
28 float timeus;
29 float samplingRate; //used for getPrint()
30 int numFrames;
31 bool enabled; //whether it actually reads the clock or not
32 int numAverages;
33 char *name;
34 void init(int aNumAverages, int aNumFrames, float aSamplingRate, const char *aName);
35 public:
36 Interval();
37 Interval(int aNumAverages);
38 Interval(int aNumAverages, int aNumFrames, float aSamplingRate, const char *aName);
39 ~Interval();
40 void setNumFrames(int aNumFrames);
41 int start();
42 int resetMax();
43 int split();
44 void setEnabled(bool aActive);
45 float getTimeus();
46 float getMaxTimeus();
47 void print();
48 };
49
50 #endif /* INTERVALS_H_ */