Skip to content

Commit

Permalink
create Moment.now
Browse files Browse the repository at this point in the history
  • Loading branch information
sullyj3 committed Aug 4, 2024
1 parent 1a23f39 commit 6188d56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sand/SandDaemon/HandleCommand.lean
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private partial def countdown (id : TimerId) (due : Moment) : CmdHandlerT IO Uni
loop
where
loop := do
let now ← Moment.mk <$> IO.monoMsNow
let now ← Moment.now
let remaining := due - now
-- This task will be cancelled if the timer is cancelled or paused.
-- in case of resumed, a new separate task will be spawned.
Expand Down
2 changes: 2 additions & 0 deletions src/Sand/Time.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ structure Moment where
millis : Nat
deriving Repr, ToJson, FromJson, BEq

def Moment.now : IO Moment := Moment.mk <$> IO.monoMsNow

structure Duration where
millis : Nat
deriving Repr, ToJson, FromJson, BEq
Expand Down

0 comments on commit 6188d56

Please sign in to comment.