MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Add

Method Add

src/framerate_gui.cpp:85–93  ·  view source on GitHub ↗

Collect a complete measurement, given start and ending times for a processing block */

Source from the content-addressed store, hash-verified

83
84 /** Collect a complete measurement, given start and ending times for a processing block */
85 void Add(TimingMeasurement start_time, TimingMeasurement end_time)
86 {
87 this->durations[this->next_index] = end_time - start_time;
88 this->timestamps[this->next_index] = start_time;
89 this->prev_index = this->next_index;
90 this->next_index += 1;
91 if (this->next_index >= NUM_FRAMERATE_POINTS) this->next_index = 0;
92 this->num_valid = std::min(NUM_FRAMERATE_POINTS, this->num_valid + 1);
93 }
94
95 /** Begin an accumulation of multiple measurements into a single value, from a given start time */
96 void BeginAccumulate(TimingMeasurement start_time)

Callers 2

~PerformanceMeasurerMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected