Skip to main content

Module fps

Module fps 

Source
Expand description

Frame-rate HUD for interactive performance testing. Frame-rate HUD for interactive performance testing.

GPUI (at the pinned revision) ships no FPS widget, so this module provides a minimal one with zero forced repaints:

  • FrameStats samples one timestamp per rendered frame and reports rolling FPS plus average/worst frame times over a short window.
  • fps_badge renders those stats as a color-coded chip hosts can drop into any status bar.

The editor canvas records a sample on every prepaint (crate::Editor::frame_stats), so the number reflects real editor frames: it updates while interacting (typing, selection drags, scrolling) and freezes when idle — which is correct, since no frames are being produced then.

Structs§

FrameStats
Rolling frame-time statistics sampled once per rendered frame.

Functions§

fps_badge
Renders FrameStats as a color-coded status-bar chip.