Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.GLib.Structs.Timer
Description
Opaque datatype that records a start time.
- newtype Timer = Timer (ManagedPtr Timer)
- noTimer :: Maybe Timer
- data TimerContinueMethodInfo
- timerContinue :: (HasCallStack, MonadIO m) => Timer -> m ()
- data TimerDestroyMethodInfo
- timerDestroy :: (HasCallStack, MonadIO m) => Timer -> m ()
- data TimerElapsedMethodInfo
- timerElapsed :: (HasCallStack, MonadIO m) => Timer -> CULong -> m Double
- data TimerResetMethodInfo
- timerReset :: (HasCallStack, MonadIO m) => Timer -> m ()
- data TimerStartMethodInfo
- timerStart :: (HasCallStack, MonadIO m) => Timer -> m ()
- data TimerStopMethodInfo
- timerStop :: (HasCallStack, MonadIO m) => Timer -> m ()
Exported types
Constructors
Timer (ManagedPtr Timer) |
Instances
WrappedPtr Timer Source # | |
((~) * info (ResolveTimerMethod t Timer), MethodInfo * info Timer p) => IsLabel t (Timer -> p) Source # | |
((~) * info (ResolveTimerMethod t Timer), MethodInfo * info Timer p) => IsLabelProxy t (Timer -> p) Source # | |
HasAttributeList * Timer Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerStopMethodInfo Timer signature Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerStartMethodInfo Timer signature Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerResetMethodInfo Timer signature Source # | |
((~) * signature (CULong -> m Double), MonadIO m) => MethodInfo * TimerElapsedMethodInfo Timer signature Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerDestroyMethodInfo Timer signature Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerContinueMethodInfo Timer signature Source # | |
type AttributeList Timer Source # | |
Methods
continue
data TimerContinueMethodInfo Source #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerContinueMethodInfo Timer signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Timer |
|
-> m () |
destroy
data TimerDestroyMethodInfo Source #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerDestroyMethodInfo Timer signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Timer |
|
-> m () |
Destroys a timer, freeing associated resources.
elapsed
data TimerElapsedMethodInfo Source #
Instances
((~) * signature (CULong -> m Double), MonadIO m) => MethodInfo * TimerElapsedMethodInfo Timer signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Timer |
|
-> CULong |
|
-> m Double | Returns: seconds elapsed as a floating point value, including any fractional part. |
If timer
has been started but not stopped, obtains the time since
the timer was started. If timer
has been stopped, obtains the
elapsed time between the time it was started and the time it was
stopped. The return value is the number of seconds elapsed,
including any fractional part. The microseconds
out parameter is
essentially useless.
reset
data TimerResetMethodInfo Source #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerResetMethodInfo Timer signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Timer |
|
-> m () |
This function is useless; it's fine to call timerStart
on an
already-started timer to reset the start time, so timerReset
serves no purpose.
start
data TimerStartMethodInfo Source #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerStartMethodInfo Timer signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Timer |
|
-> m () |
Marks a start time, so that future calls to timerElapsed
will
report the time since timerStart
was called. g_timer_new()
automatically marks the start time, so no need to call
timerStart
immediately after creating the timer.
stop
data TimerStopMethodInfo Source #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * TimerStopMethodInfo Timer signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Timer |
|
-> m () |
Marks an end time, so calls to timerElapsed
will return the
difference between this end time and the start time.