Closed
Description
This is a use case I have often when timing things.
I would like to avoid running unInstant
in application code.
Maybe like this:
-- | Get the amount of milliseconds between the first and second Instant
-- | for example:
-- | ```
-- | do
-- | start <- Instant.now
-- | aLongRunningEffect
-- | end <- Instant.now
-- | let duration = Instant.delta end start
-- | log ("A long running effect took " <> show duration)
-- | ```
delta ∷ Instant → Instant → Milliseconds
delta i1 i2 = (unInstant i1) <> negateDuration (unInstant i2)
Metadata
Metadata
Assignees
Labels
No labels