]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Prelude/Clock.hs
[CLEAN] creating Prelude.GargDB file
[gargantext.git] / src / Gargantext / Prelude / Clock.hs
1 {-|
2 Module : Gargantext.Prelude.Clock
3 Description : Useful Tools near Prelude of the project
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 module Gargantext.Prelude.Clock
13 where
14
15 import Data.Aeson (ToJSON, toJSON)
16 import Formatting.Clock (timeSpecs)
17 import Formatting.Internal (Format(..))
18 import Gargantext.Prelude
19 import qualified System.Clock as Clock (getTime, TimeSpec, Clock(..))
20
21 ---------------------------------------------------------------------------------
22 getTime :: MonadBase IO m => m Clock.TimeSpec
23 getTime = liftBase $ Clock.getTime Clock.ProcessCPUTime
24
25 hasTime :: Formatting.Internal.Format r (Clock.TimeSpec -> Clock.TimeSpec -> r)
26 hasTime = timeSpecs
27
28