libretro.drivers.perf.driver

Protocol definition for the performance counter interface.

See also

libretro.api.perf

The matching ctypes types and callback definitions.

Classes

PerfDriver

Protocol for drivers that expose the libretro performance-counter interface.

class PerfDriver[source]

Bases: Protocol

Protocol for drivers that expose the libretro performance-counter interface.

See also

libretro.api.perf

The matching ctypes types and callback definitions.

abstractmethod get_time_usec()[source]

Return the current wall-clock time in microseconds.

See also

retro_perf_get_time_usec_t

The C function pointer type whose signature this method implements.

Return type:

int

abstractmethod get_cpu_features()[source]

Return a bitmask of CPU features available to the core.

See also

CpuFeatures

Bit flags describing each supported CPU feature.

Return type:

CpuFeatures

abstractmethod get_perf_counter()[source]

Return the current value of the high-resolution performance counter.

Units are driver-defined but consistent within a single process.

See also

retro_perf_get_counter_t

The C function pointer type whose signature this method implements.

Return type:

int

abstractmethod perf_register(counter)[source]

Register a new performance counter with the driver.

Parameters:

counter (retro_perf_counter) – The counter struct to register.

See also

retro_perf_register_t

The C function pointer type whose signature this method implements.

Return type:

None

abstractmethod perf_start(counter)[source]

Start measuring a previously registered performance counter.

Parameters:

counter (retro_perf_counter) – The counter to start.

See also

retro_perf_start_t

The C function pointer type whose signature this method implements.

Return type:

None

abstractmethod perf_stop(counter)[source]

Stop measuring a previously started performance counter.

Parameters:

counter (retro_perf_counter) – The counter to stop.

See also

retro_perf_stop_t

The C function pointer type whose signature this method implements.

Return type:

None

abstractmethod perf_log()[source]

Emit accumulated performance-counter measurements to the driver’s log sink.

See also

retro_perf_log_t

The C function pointer type whose signature this method implements.

Return type:

None

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)