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

Function GetPerformanceTimer

src/framerate_gui.cpp:236–240  ·  view source on GitHub ↗

* Return a timestamp with \c TIMESTAMP_PRECISION ticks per second precision. * The basis of the timestamp is implementation defined, but the value should be steady, * so differences can be taken to reliably measure intervals. */

Source from the content-addressed store, hash-verified

234 * so differences can be taken to reliably measure intervals.
235 */
236static TimingMeasurement GetPerformanceTimer()
237{
238 using namespace std::chrono;
239 return (TimingMeasurement)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count();
240}
241
242
243/**

Callers 6

PerformanceMeasurerMethod · 0.85
~PerformanceMeasurerMethod · 0.85
PausedMethod · 0.85
ResetMethod · 0.85

Calls 2

nowClass · 0.85
countMethod · 0.45

Tested by

no test coverage detected