hs-hourglass icon indicating copy to clipboard operation
hs-hourglass copied to clipboard

Add a `rationalToElapsedP` function

Open ad-si opened this issue 4 years ago • 0 comments

For example:

rationalToElapsedP :: Rational -> ElapsedP
rationalToElapsedP secondsFrac =
  let (sec, nanoSec) = properFraction secondsFrac
  in ElapsedP (Elapsed (Seconds sec)) (NanoSeconds $ truncate $ nanoSec * 1e9)

ad-si avatar Apr 10 '20 20:04 ad-si