SObjectizer
5.7
|
Functions | |
duration_t | calc_avg_time (std::uint_fast64_t count, duration_t previous, duration_t last) |
A function for calculating average value. More... | |
void | update_stats_from_duration (activity_stats_t &value_to_update, clock_type_t::duration last_duration) |
Helper function for simplification of current stats update. More... | |
void | update_stats_from_current_time (activity_stats_t &value_to_update, clock_type_t::time_point activity_started_at) |
Helper function for simplification of current stats update. More... | |
|
inline |
A function for calculating average value.
Uses modified moving average (also known as running moving average) which is calculated as: MMA(t) = (last + (N-1)*MMA(t-1))/N.
count | Total count of samples. |
previous | Previous average value. |
last | Duration of last activity (or waiting). |
|
inline |
Helper function for simplification of current stats update.
|
inline |
Helper function for simplification of current stats update.