{-# LINE 1 "libraries/ghc-internal/src/GHC/Internal/Clock.hsc" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}

module GHC.Internal.Clock
    ( getMonotonicTime
    , getMonotonicTimeNSec
    ) where

import GHC.Internal.Base (return)
import GHC.Internal.Real
import GHC.Internal.Word
import GHC.Internal.Types (Double, IO)
import GHC.Internal.Float () -- for Num Double instance

{-# LINE 18 "libraries/ghc-internal/src/GHC/Internal/Clock.hsc" #-}

-- | Return monotonic time in seconds, since some unspecified starting point
--
-- @since base-4.11.0.0
getMonotonicTime :: IO Double
getMonotonicTime :: IO Double
getMonotonicTime = do

{-# LINE 28 "libraries/ghc-internal/src/GHC/Internal/Clock.hsc" #-}
  w <- IO Word64
getMonotonicTimeNSec
  return (fromIntegral w / 1000000000)

{-# LINE 31 "libraries/ghc-internal/src/GHC/Internal/Clock.hsc" #-}

-- | Return monotonic time in nanoseconds, since some unspecified starting point
--
-- @since base-4.11.0.0

{-# LINE 45 "libraries/ghc-internal/src/GHC/Internal/Clock.hsc" #-}
foreign import ccall unsafe "getMonotonicNSec"
    getMonotonicTimeNSec :: IO Word64

{-# LINE 48 "libraries/ghc-internal/src/GHC/Internal/Clock.hsc" #-}