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)
72
72
73
73
class Timer
74
74
def initialize
75
- @start = Time . now
75
+ @start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second )
76
76
end
77
77
78
78
def stop
79
- Time . now - @start
79
+ Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second ) - @start
80
80
end
81
81
end
82
82
end
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ class Timer
21
21
FOUR_DECIMAL_DIGITS = '%0.4f'
22
22
23
23
def initialize
24
- @start = Time . now
24
+ @start = Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second )
25
25
end
26
26
27
27
def stop
28
- @time = Time . now - @start
28
+ @time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC , :float_second ) - @start
29
29
@time
30
30
end
31
31
You can’t perform that action at this time.
0 commit comments