coastline 0.0.4
Loading...
Searching...
No Matches
coastline::FrameTimings Class Reference

One-second timing averages and worst values since collection began. More...

#include <performance.h>

Classes

struct  Snapshot
 Completed sampling interval averages and extrema since the first recorded frame. More...

Public Member Functions

bool Record (std::uint64_t workNanoseconds, std::uint64_t now)
 Accumulate a frame and publish averages after at least one second of timestamp progress.
const std::optional< Snapshot > & Latest () const

Detailed Description

One-second timing averages and worst values since collection began.

Member Function Documentation

◆ Record()

bool coastline::FrameTimings::Record ( std::uint64_t workNanoseconds,
std::uint64_t now )
inline

Accumulate a frame and publish averages after at least one second of timestamp progress.

Parameters
workNanosecondsCPU work duration in nanoseconds, excluding presentation and pacing.
nowA monotonically increasing timestamp in nanoseconds from a consistent clock.
Returns
Whether a new snapshot became available during this call.

◆ Latest()

const std::optional< Snapshot > & coastline::FrameTimings::Latest ( ) const
inline
Returns
The latest snapshot, absent until one second elapses. The reference remains valid for this collector's lifetime; Record() can replace its value.

The documentation for this class was generated from the following file: