MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / Tick

Method Tick

PanzerChasm/ticks_counter.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{}
18
19void 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
35float TicksCounter::GetTicksFrequency() const
36{

Callers

nothing calls this directly

Calls 1

ToSecondsMethod · 0.80

Tested by

no test coverage detected