fixed-timestep-0.1.0.0: Pure Haskell library to repeat an action at a specific frequency.

Safe HaskellNone
LanguageHaskell2010

Time.Flick

Contents

Description

A simple implementation of flicks, using 64-bit integers. See https://github.com/OculusVR/Flicks#README for the spec.

Synopsis

The Flicks data type

newtype Flicks Source #

Time measured in units of flicks. One flick is precisely 1/705600000 seconds. Many common frame rates produce frame times which are an integer number of flicks.

Constructors

Flicks 

Fields

Instances
Enum Flicks Source # 
Instance details

Defined in Time.Flick

Eq Flicks Source # 
Instance details

Defined in Time.Flick

Methods

(==) :: Flicks -> Flicks -> Bool #

(/=) :: Flicks -> Flicks -> Bool #

Integral Flicks Source # 
Instance details

Defined in Time.Flick

Num Flicks Source # 
Instance details

Defined in Time.Flick

Ord Flicks Source # 
Instance details

Defined in Time.Flick

Real Flicks Source # 
Instance details

Defined in Time.Flick

Show Flicks Source # 
Instance details

Defined in Time.Flick

flicksPerSecond :: Num a => a Source #

How many flicks are in a second. Precisely 705600000.

secnd :: Flicks Source #

One second in flicks.

Conversions

approxFlicks :: Rational -> Flicks Source #

Convert a number of seconds into flicks, rounding towards zero.

periodForFreq :: Rational -> Flicks Source #

Duration in flicks of one oscillation at the given frequency (in Hertz). The result is rounded towards zero.

timeSpecToFlicks :: TimeSpec -> Flicks Source #

Convert a TimeSpec into flicks. Rounds towards zero.

flicksToDiffTime :: Flicks -> DiffTime Source #

Convert flicks into DiffTime

Measuring time in flicks

flicksNow :: Clock -> IO Flicks Source #

Get the current time in flicks. The epoch is an arbitrary starting point and the maginute of the result should not be relied on.

See the documentation of System.Clock for details.

threadDelayFlicks :: Flicks -> IO () Source #

Suspend the current thread for a given duration. Inherits threadDelay 's lack of guarantees.