Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
Clock
- = Monotonic
- | Realtime
- | ProcessCPUTime
- | ThreadCPUTime
- | MonotonicRaw
- newtype Seconds = Seconds { }
- getTime :: Clock -> IO Seconds
- getRes :: Clock -> IO Seconds
- fromNanoSecs :: Integer -> Seconds
- toNanoSecs :: Seconds -> Integer
- diffTimeSpec :: Seconds -> Seconds -> Seconds
Documentation
Clock types. A clock may be system-wide (that is, visible to all processes)
or per-process (measuring time that is meaningful only within a process).
All implementations shall support
Realtime
.
Monotonic |
The identifier for the system-wide monotonic clock, which is defined as
a clock measuring real time, whose value cannot be set via
|
Realtime |
The identifier of the system-wide clock measuring real time. For this
clock, the value returned by
|
ProcessCPUTime |
The identifier of the CPU-time clock associated with the calling
process. For this clock, the value returned by
|
ThreadCPUTime |
The identifier of the CPU-time clock associated with the calling OS
thread. For this clock, the value returned by
|
MonotonicRaw |
(since Linux 2.6.28, macOS 10.12)
Similar to
|
Instances
Enum Clock Source # | |
Defined in System.Clock succ :: Clock -> Clock Source # pred :: Clock -> Clock Source # toEnum :: Int -> Clock Source # fromEnum :: Clock -> Int Source # enumFrom :: Clock -> [ Clock ] Source # enumFromThen :: Clock -> Clock -> [ Clock ] Source # enumFromTo :: Clock -> Clock -> [ Clock ] Source # enumFromThenTo :: Clock -> Clock -> Clock -> [ Clock ] Source # |
|
Eq Clock Source # | |
Read Clock Source # | |
Show Clock Source # | |
Generic Clock Source # | |
type Rep Clock Source # | |
Defined in System.Clock
type
Rep
Clock
=
D1
('
MetaData
"Clock" "System.Clock" "clock-0.8.3-Kuh58kurzD7fuR5UAL40C" '
False
) ((
C1
('
MetaCons
"Monotonic" '
PrefixI
'
False
) (
U1
::
Type
->
Type
)
:+:
C1
('
MetaCons
"Realtime" '
PrefixI
'
False
) (
U1
::
Type
->
Type
))
:+:
(
C1
('
MetaCons
"ProcessCPUTime" '
PrefixI
'
False
) (
U1
::
Type
->
Type
)
:+:
(
C1
('
MetaCons
"ThreadCPUTime" '
PrefixI
'
False
) (
U1
::
Type
->
Type
)
:+:
C1
('
MetaCons
"MonotonicRaw" '
PrefixI
'
False
) (
U1
::
Type
->
Type
))))
|
Instances
getTime :: Clock -> IO Seconds Source #
The
getTime
function shall return the current value for the
specified clock.
getRes :: Clock -> IO Seconds Source #
The
getRes
function shall return the resolution of any clock.
Clock resolutions are implementation-defined and cannot be set
by a process.
fromNanoSecs :: Integer -> Seconds Source #
Seconds from nano seconds.
toNanoSecs :: Seconds -> Integer Source #
Seconds to nano seconds.