API Reference › Anim › Anim.duration
method

Anim.duration

Anim.duration(fps, count) -> fixed

Returns the length of one cycle of a clip in seconds as a fixed: count / fps. Handy to schedule the next event, size a progress bar, or line a tween up with an animation.

Parameters

fpsframes per second
countnumber of frames in the clip

Example

program Demo {
  handler Run phase Update {
    let secs = Anim.duration(12, 4)   # 4 frames / 12 fps = 0.333s
    print(secs)
  }
}
← All symbols