diff options
Diffstat (limited to 'src/common.hpp')
-rw-r--r-- | src/common.hpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/common.hpp b/src/common.hpp index 1cd1921..bb95f0e 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -40,6 +40,27 @@ extern bool debug_AI; typedef uint64_t ntime_t; ntime_t nclock(void); +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); + +public: + freq_counter_t(size_t num_samples_); + ~freq_counter_t(void); + + void tick(void); + float freq_ma(void); +}; + +extern freq_counter_t fc_render; +extern freq_counter_t fc_game; + namespace procgen { class prng_t { uint32_t state = 0; @@ -351,9 +372,6 @@ namespace interface { std::list<log_entry_t> log; - double perf_hist[10] = {0}; - size_t perf_hist_index = 0; - void start_following(void); void stop_following(void); |