jjant/elm-fps/1.0.0

Fps

This library allows you to easily compute minimum, maximum, and average FPS for your application.

Setup

type Model
init : Int -> Model

Initializes the model, takes an integer representing how many frames we consider for the average FPS.

Usually, 20 is a good number to perceive regular variations in FPS.

type Msg

Update the state when a new frame time is received.

Subscribes to animation frame to compute frame times.

View

fps :
-> Maybe
{ average : Float
, min : Float
, max : Float
}

Get FPS information.

Returns Nothing if no frame times have been received yet.