Skip to content

Commit

Permalink
feat: add Ferrum::Utils::ElapsedTime#reset
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Feb 18, 2025
1 parent dad31db commit 3e50daa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ferrum/utils/elapsed_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def start
@start ||= monotonic_time
end

def reset
@start = monotonic_time
end

def elapsed_time(start = nil)
monotonic_time - (start || @start)
end
Expand Down

0 comments on commit 3e50daa

Please sign in to comment.