{-# LINE 1 "libraries/base/GHC/Clock.hsc" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}

module GHC.Clock
    ( getMonotonicTime
    , getMonotonicTimeNSec
    ) where

import GHC.Base
import GHC.Real
import Data.Word

{-# LINE 16 "libraries/base/GHC/Clock.hsc" #-}

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

{-# LINE 26 "libraries/base/GHC/Clock.hsc" #-}
  Word64
w <- IO Word64
getMonotonicTimeNSec
  Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64 -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
w Double -> Double -> Double
forall a. Fractional a => a -> a -> a
/ Double
1000000000)

{-# LINE 29 "libraries/base/GHC/Clock.hsc" #-}

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

{-# LINE 43 "libraries/base/GHC/Clock.hsc" #-}
foreign import ccall unsafe "getMonotonicNSec"
    getMonotonicTimeNSec :: IO Word64

{-# LINE 46 "libraries/base/GHC/Clock.hsc" #-}