Updated
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
type WaveState structWaveState holds the computed wave values for a single frame.
#ComputeWaves
go
func ComputeWaves(t float64, isLast bool) WaveStateComputeWaves calculates the sawtooth wave values at time fraction t (0-1). isLast pins all values to 100%.
#Run
go
func Run(durationSec int) errorRun executes the demo animation for the given duration in seconds.