Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs, comments to nudge timing with monotonic clock #214

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ will continue invocation of the interactor. For example, with a block:

```ruby
around do |interactor|
context.start_time = Time.now
context.start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
interactor.call
context.finish_time = Time.now
context.finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
```

Expand All @@ -141,9 +141,9 @@ With a method:
around :time_execution

def time_execution(interactor)
context.start_time = Time.now
context.start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
interactor.call
context.finish_time = Time.now
context.finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
```

Expand Down Expand Up @@ -209,9 +209,9 @@ module InteractorTimer

included do
around do |interactor|
context.start_time = Time.now
context.start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
interactor.call
context.finish_time = Time.now
context.finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/interactor/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ module ClassMethods
# private
#
# def time_execution(interactor)
# context.start_time = Time.now
# context.start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
# interactor.call
# context.finish_time = Time.now
# context.finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
# end
# end
#
Expand Down Expand Up @@ -80,7 +80,7 @@ def around(*hooks, &block)
# private
#
# def set_start_time
# context.start_time = Time.now
# context.start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
# end
# end
#
Expand Down Expand Up @@ -117,7 +117,7 @@ def before(*hooks, &block)
# private
#
# def set_finish_time
# context.finish_time = Time.now
# context.finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
# end
# end
#
Expand Down