clock-0.1.1: low-level binding to time.h: clock_gettime and clock_getres

System.CPUTime.Clock

Description

From time.h, provides clockid_t, timespec, clock_gettime, clock_getres.

Synopsis

Documentation

data Clock Source

Clock types

Constructors

Monotonic

Clock that cannot be set and represents monotonic time since some unspecified starting point.

Realtime

System-wide realtime clock

ProcessTime

High-resolution per-process timer from the CPU.

ThreadTime

Thread-specific CPU-time clock.

data TimeSpec Source

TimeSpec structure

Constructors

Time Int Int 

clock_gettime :: Clock -> IO TimeSpecSource

Retrieves the time of the specified clock.

clock_getres :: Clock -> IO TimeSpecSource

Finds the resolution (precision) of the specified clock.

sec :: TimeSpec -> IntSource

Seconds of a TimeSpec

nsec :: TimeSpec -> IntSource

Nanoseconds of a TimeSpec