howmuchleft v0.14.1 /internal/demo
On this page

Runs a terminal animation showing sawtooth-wave simulated usage across context window, 5-hour, weekly, and extra usage bars.

#internal/demo

#internal/demo

#WaveState

Go go
type WaveState struct

WaveState holds the computed wave values for a single frame.

#ComputeWaves

Go go
func ComputeWaves(t float64, isLast bool) WaveState

ComputeWaves calculates the sawtooth wave values at time fraction t (0-1). isLast pins all values to 100%.

#Run

Go go
func Run(durationSec int) error

Run executes the demo animation for the given duration in seconds.

Search