File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,11 @@ def add_time(time)
7272
7373 class Timer
7474 def initialize
75- @start = Time . now
75+ @start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second )
7676 end
7777
7878 def stop
79- Time . now - @start
79+ Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second ) - @start
8080 end
8181 end
8282end
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ class Timer
2121 FOUR_DECIMAL_DIGITS = '%0.4f'
2222
2323 def initialize
24- @start = Time . now
24+ @start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second )
2525 end
2626
2727 def stop
28- @time = Time . now - @start
28+ @time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second ) - @start
2929 @time
3030 end
3131
You can’t perform that action at this time.
0 commit comments