diff options
Diffstat (limited to 'src/common.hpp')
-rw-r--r-- | src/common.hpp | 16 |
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; |