Skip to content

Commit 7551cc6

Browse files
committed
Removed confusing parameter from Concurrent.monotonic_time.
1 parent 132dfae commit 7551cc6

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

lib/concurrent/utility/monotonic_time.rb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module Concurrent
77

88
if defined?(Process::CLOCK_MONOTONIC)
99
# @!visibility private
10-
def get_time(since = 0.0)
11-
Process.clock_gettime(Process::CLOCK_MONOTONIC) - since.to_f
10+
def get_time
11+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
1212
end
1313
elsif RUBY_PLATFORM == 'java'
1414
# @!visibility private
15-
def get_time(since = 0.0)
16-
(java.lang.System.nanoTime() / 1_000_000_000.0) - since.to_f
15+
def get_time
16+
java.lang.System.nanoTime() / 1_000_000_000.0
1717
end
1818
else
1919

@@ -27,7 +27,7 @@ def initialize
2727
end
2828

2929
# @!visibility private
30-
def get_time(since = 0.0)
30+
def get_time
3131
@mutex.synchronize {
3232
@correction ||= 0 # compensating any back time shifts
3333
now = Time.now.to_f
@@ -38,26 +38,21 @@ def get_time(since = 0.0)
3838
@correction += @last_time - corrected_now + 0.000_001
3939
@last_time = @correction + now
4040
end
41-
} - since.to_f
41+
}
4242
end
4343
end
4444
}.new
4545

4646
# @!macro [attach] monotonic_get_time
4747
#
4848
# Returns the current time a tracked by the application monotonic clock.
49-
# When no `since` time is given the return value will bet he current time.
50-
# When an `since` value is given the return value will be the monotonic time
51-
# interval which has been passed since the `since` time.
5249
#
53-
# @param [Float] since the monotonic time from which to calculate
54-
# the time interval
5550
# @return [Float] The current monotonic time when `since` not given else
5651
# the elapsed monotonic time between `since` and the current time
5752
#
5853
# @!macro monotonic_clock_warning
59-
def monotonic_time(since = 0.0)
60-
GLOBAL_MONOTONIC_CLOCK.get_time(since)
54+
def monotonic_time
55+
GLOBAL_MONOTONIC_CLOCK.get_time
6156
end
6257
module_function :monotonic_time
6358
end

0 commit comments

Comments
 (0)