{-# LANGUAGE ScopedTypeVariables #-}

module Data.Time.Extras where

import Control.Concurrent.Thread.Delay
import Data.Fixed
import Data.Fixed.Extras
import Data.Time
import Prelude

delayMicro :: Micro -> IO ()
delayMicro :: Micro -> IO ()
delayMicro (MkFixed Integer
mus) = Integer -> IO ()
delay Integer
mus

delayNominalDiffTime :: NominalDiffTime -> IO ()
delayNominalDiffTime :: NominalDiffTime -> IO ()
delayNominalDiffTime = Micro -> IO ()
delayMicro (Micro -> IO ())
-> (NominalDiffTime -> Micro) -> NominalDiffTime -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NominalDiffTime -> Integer) -> NominalDiffTime -> Micro
forall res a.
(Num a, HasResolution res) =>
(a -> Integer) -> a -> Fixed res
toFixed NominalDiffTime -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
ceiling