diff --git a/HTF.cabal b/HTF.cabal index a29a942..fdea512 100644 --- a/HTF.cabal +++ b/HTF.cabal @@ -146,7 +146,6 @@ Library random >= 1.0, regex-compat >= 0.92, text >= 0.11, - time >= 1.8 && < 1.15, time, vector, xmlgen >= 0.6 diff --git a/Test/Framework/Utils.hs b/Test/Framework/Utils.hs index 9dffb3a..e46dccb 100644 --- a/Test/Framework/Utils.hs +++ b/Test/Framework/Utils.hs @@ -22,7 +22,11 @@ module Test.Framework.Utils where import System.Directory import Data.Char +#if MIN_VERSION_base(4,11,0) +import GHC.Clock (getMonotonicTimeNSec) +#else import Data.Time.Clock.POSIX (getPOSIXTime) +#endif import System.Random import Data.Array.IO import Control.Monad @@ -150,8 +154,13 @@ measure ma = return (a, fromInteger (diffMicro `div` 1000)) getMicroTime :: IO Integer +#if MIN_VERSION_base(4,11,0) +getMicroTime = + (`div` 1000) . fromIntegral <$> getMonotonicTimeNSec +#else getMicroTime = floor . (* 1000000) <$> getPOSIXTime +#endif -- | Randomly shuffle a list -- /O(N)/