Skip to content

Commit bc2fd4e

Browse files
Merge #3735
3735: Import `getMonotonicNSec` from base rather than via FFI r=amesgen a=amesgen `getMonotonicTimeNSec` from `GHC.Clock` is this exact FFI import. Co-authored-by: Alexander Esgen <[email protected]>
2 parents 7a4962b + f45299a commit bc2fd4e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

io-classes/src/Control/Monad/Class/MonadTime.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Data.Time.Clock (DiffTime, NominalDiffTime, UTCTime,
2020
addUTCTime, diffUTCTime)
2121
import qualified Data.Time.Clock as Time
2222
import Data.Word (Word64)
23+
import GHC.Clock (getMonotonicTimeNSec)
2324
import GHC.Generics (Generic (..))
2425

2526
-- | A point in time in a monotonic clock.
@@ -59,17 +60,14 @@ class MonadMonotonicTime m => MonadTime m where
5960

6061
instance MonadMonotonicTime IO where
6162
getMonotonicTime =
62-
fmap conv getMonotonicNSec
63+
fmap conv getMonotonicTimeNSec
6364
where
6465
conv :: Word64 -> Time
6566
conv = Time . Time.picosecondsToDiffTime . (* 1000) . toInteger
6667

6768
instance MonadTime IO where
6869
getCurrentTime = Time.getCurrentTime
6970

70-
foreign import ccall unsafe "getMonotonicNSec"
71-
getMonotonicNSec :: IO Word64
72-
7371
--
7472
-- Instance for ReaderT
7573
--

0 commit comments

Comments
 (0)