imj-base-0.1.0.2: Game engine with geometry, easing, animated text, delta rendering.

Safe HaskellSafe
LanguageHaskell2010

Imj.Timing

Contents

Description

This modules exports types and functions related to timing.

Synopsis

KeyTime

A wrapper type on SystemTime

newtype KeyTime Source #

Represents deadlines and event times.

Constructors

KeyTime SystemTime 

SystemTime / DiffTime utilities

diffSystemTime Source #

Arguments

:: SystemTime

t1

-> SystemTime

t2

-> DiffTime 

Returns t1-t2

diffTimeSecToMicros :: DiffTime -> Int Source #

Convert a DiffTime to a number of microseconds.

floatSecondsToDiffTime :: Float -> DiffTime Source #

Converts a duration expressed in seconds using a Float to a DiffTime which has picosecond resolution.

Reexports

data SystemTime :: * #

SystemTime is time returned by system clock functions. Its semantics depends on the clock function, but the epoch is typically the beginning of 1970. Note that systemNanoseconds of 1E9 to 2E9-1 can be used to represent leap seconds.

data DiffTime :: * #

This is a length of time, as measured by a clock. Conversion functions will treat it as seconds. It has a precision of 10^-12 s.

Instances

Enum DiffTime 
Eq DiffTime 
Fractional DiffTime 
Data DiffTime 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime #

toConstr :: DiffTime -> Constr #

dataTypeOf :: DiffTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) #

gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime #

Num DiffTime 
Ord DiffTime 
Real DiffTime 
RealFrac DiffTime 

Methods

properFraction :: Integral b => DiffTime -> (b, DiffTime) #

truncate :: Integral b => DiffTime -> b #

round :: Integral b => DiffTime -> b #

ceiling :: Integral b => DiffTime -> b #

floor :: Integral b => DiffTime -> b #

Show DiffTime 
NFData DiffTime 

Methods

rnf :: DiffTime -> () #

getSystemTime :: IO SystemTime #

Get the system time, epoch start of 1970 UTC, leap-seconds ignored. getSystemTime is typically much faster than getCurrentTime.