Egui::Bench
Class methods
Free-form monotonic counter ("fonts.layout.hit" etc.) — volume facts that explain the span numbers.
Drive app headless: warmup frames (caches fill — Svg bakes,
glyph atlas fills), then frames measured ones, running
scenario before each frame so it can move the app into the
state under test (mouse moves, router navigation, direct state
pokes through driver.app). With mouse: true (default) each
frame also gets a pointer move at the screen center — the
"idle but the cursor moves" worst case for repaint-heavy apps.
The app's Context is prepared for realistic headless measuring: the font backend the caller installed stays (put a real one there for realistic measure() costs), and the texture registry becomes a graphical dummy so Svg icons take their production code path. pixels_per_point stays whatever the ctx has (1.0 unless set).
Blockless convenience overload: the default injected mouse move (the "cursor moves, nothing else happens" scenario) is all the frame needs.
Returns the Report (also printed to STDOUT unless print: false).
Time the block under name while a bench runs; passes the
block's value through (the guard may wrap value-producing calls,
e.g. Context#end_frame's command flatten). Overhead when not
collecting: one class-var read + an inlined yield.