Module: Ruby2D::Benchmark::Clock

Defined in:
lib/ruby2d/benchmark.rb

Overview

Per-frame CPU/present split. The wall-clock frame delta the harness records includes SDL_RenderPresent, which on a desktop compositor can be the dominant, floor-setting cost — so raw fps hides whether a change moved the CPU work at all (an empty window can even measure slower than a populated one). These accumulators, filled by the two wrappers installed in run, let the report separate CPU-build time from the present wait. present_ns — time inside Ext.end_frame (≈ present; the cap delay is off at fps_cap :infinity) render_ns — time inside Window#render_objects (scene-graph draw: dispatch + FFI marshaling, plus any render do block) Both are summed per frame and read+reset each update tick. Wrapper-only state lives here (module methods can't close over harness locals); it is bench-only and never loaded by the gem proper.

Class Attribute Summary collapse

Class Attribute Details

.present_nsObject

Returns the value of attribute present_ns.



33
34
35
# File 'lib/ruby2d/benchmark.rb', line 33

def present_ns
  @present_ns
end

.render_nsObject

Returns the value of attribute render_ns.



33
34
35
# File 'lib/ruby2d/benchmark.rb', line 33

def render_ns
  @render_ns
end