Frametime extension type

An extension over int storing the value in count.

Frametime units are for frame-perfect or even pixel-perfect applications. They cannot be fractional. For frames over a delay, see Tickrate.

This extension overrides the basic addition, subtraction, and comparison operators. Shorthand inc and dec functions are provided for one tick.

Conversions from Duration are lossy because only full frames are counted.

on

Constructors

Frametime(int count)
const
Frametime.fromDuration(Duration from)
Lossy convert Duration to Frametime. count = (milli/1000)*hz.

Properties

count int
final

Methods

dec() Frametime
inc() Frametime
toDuration() Duration
Convert Frametime to Duration up to milliseconds precision.

Static Properties

framesPerSecond int
Mutable framesPerSecond can be changed. Represents hz or frame rate.
getter/setter pair

Constants

zero → const Frametime
Shorthand for a zero value.