| 17 | {} |
| 18 | |
| 19 | void TicksCounter::Tick( const unsigned int count ) |
| 20 | { |
| 21 | total_ticks_+= count; |
| 22 | current_sample_ticks_+= count; |
| 23 | |
| 24 | const Time current_time= Time::CurrentTime(); |
| 25 | const Time dt= current_time - last_update_time_; |
| 26 | |
| 27 | if( dt >= frequency_calc_interval_ ) |
| 28 | { |
| 29 | output_ticks_frequency_= float(current_sample_ticks_) / dt.ToSeconds(); |
| 30 | current_sample_ticks_= 0u; |
| 31 | last_update_time_= current_time; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | float TicksCounter::GetTicksFrequency() const |
| 36 | { |