HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulenetwork-mux-0.11.0.0Haskell2010

Network.Mux.Time

  • 1 type
  • 3 values

DiffTime

3 declarations
newtypenewtype DiffTime
#

This is a length of time, as measured by a clock. Conversion functions such as fromInteger and realToFrac will treat it as seconds. For example, (0.010 :: DiffTime) corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

Instances19Enum, Eq, Fractional, Data, Num, Ord, …
  • Enum DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Eq DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Fractional DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Data DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Num DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Ord DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Read DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Real DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • RealFrac DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • Show DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • NFData DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime
  • FormatTime DiffTimeDefined in time-1.15 · Data.Time.Format.Format.Instances · orphan
  • ParseTime DiffTimeDefined in time-1.15 · Data.Time.Format.Parse.Instances · orphan
  • Hashable DiffTimeDefined in time-compat-1.9.9 · Data.Time.Orphans · orphan
  • FromJSON DiffTimeDefined in aeson-2.2.5.1 · Data.Aeson.Types.FromJSON

    This instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype Scientific and provide your own instance using withScientific if you want to allow larger inputs.

  • ToJSON DiffTimeDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSON
  • NoThunks DiffTimeDefined in nothunks-0.3.1 · NoThunks.Class
  • Buildable DiffTimeDefined in formatting-7.2.0 · Formatting.Buildable
  • Lift DiffTimeDefined in time-1.15 · Data.Time.Clock.Internal.DiffTime

Compact timestamp

1 declaration

This is a slightly peculiar operation: it returns the number of microseconds since an arbitrary epoch, modulo 2^32. This number of microseconds wraps every ~35 minutes.

The purpose is to give a compact timestamp (compact to send over the wire) for measuring time differences on the order of seconds or less.