libretro.drivers.perf.default

PerfDriver implementation backed by time for timestamps.

See also

PerfDriver

The protocol this driver implements.

Classes

DefaultPerfDriver

The default PerfDriver used when a Session is given no other.

class DefaultPerfDriver[source]

Bases: PerfDriver

The default PerfDriver used when a Session is given no other.

Backed by the standard time module (time.time_ns() for wall-clock and time.process_time_ns() for the perf counter).

See also

PerfDriver

The protocol this class implements.

__init__()[source]

Initialize the driver with an empty performance-counter registry.

__del__()[source]

Drop references to the registered counters before this driver is collected.

property perf_counters

A live mapping of registered performance-counter identifiers to their structs.

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

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

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

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

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

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

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

classmethod __new__(*args, **kwargs)