summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-14 15:40:24 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-14 15:41:05 +0200
commite132c6a9f75918978051e8eb23092f5d05c7c3fc (patch)
treed20a022b4991749d2a2d3bad4ebb752fbd059861 /src/common.hpp
parentbae14803b28c4e9641d0e2e7462fdc1e7405c0aa (diff)
Redo frequency counters.
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/common.hpp b/src/common.hpp
index f4ce9ff..ae4deed 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -48,21 +48,13 @@ ntime_t nclock(void);
#define MSEC(x) ((ntime_t)x * 1000000)
class freq_counter_t {
- ntime_t *samples;
- size_t num_samples, collected = 0;
- ntime_t last_tick = 0;
-
- float last_ma;
- ntime_t last_ma_time = 0;
-
- void push(ntime_t sample);
+ size_t ticks;
+ ntime_t t0 = 0;
+ float last_reading;
public:
- freq_counter_t(size_t num_samples_);
- ~freq_counter_t(void);
-
void tick(void);
- float freq_ma(void);
+ float read(ntime_t ival);
};
extern freq_counter_t fc_render;