Skip to content

Commit

Permalink
Use Time.monotonic instead of Time.now
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija authored and watzon committed Feb 15, 2020
1 parent 8be1bbd commit d3b9bf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/marionette/utils.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ module Marionette
end

def self.timeout(time, &block)
start = Time.now
start = Time.monotonic
channel = Channel(Bool).new
spawn do
until Time.now > (start + time.milliseconds)
until Time.monotonic > (start + time.milliseconds)
end
channel.send(false)
end
Expand Down

0 comments on commit d3b9bf0

Please sign in to comment.