Safe Haskell | None |
---|---|
Language | Haskell2010 |
A simple implementation of flicks, using 64-bit integers. See https://github.com/OculusVR/Flicks#README for the spec.
Synopsis
- newtype Flicks = Flicks {}
- flicksPerSecond :: Num a => a
- secnd :: Flicks
- approxFlicks :: Rational -> Flicks
- periodForFreq :: Rational -> Flicks
- timeSpecToFlicks :: TimeSpec -> Flicks
- flicksToDiffTime :: Flicks -> DiffTime
- flicksNow :: Clock -> IO Flicks
- threadDelayFlicks :: Flicks -> IO ()
The Flicks data type
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.
flicksPerSecond :: Num a => a Source #
How many flicks are in a second. Precisely 705600000.
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.
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.