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

Improve docs for Benchmark.realtime #25

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

nithinbekal
Copy link
Contributor

@nithinbekal nithinbekal commented Sep 27, 2024

Reopening this PR from ruby/ruby here: ruby/ruby#11706


The documentation for Benchmark.realtime doesn't make it clear what unit is being used. I've updated the docs to specify that it uses seconds. The module level docs do mention that Benchmark.measure returns seconds, but it is easy to miss when looking at the method docs in isolation.

Rails has recently deprecated the Benchmark.ms monkeypatch (rails/rails#52746), which means there might be more people using this in Rails app, and clarifying the unit here will make it less confusing to switch to this.

In addition, I have also added an example for the method.

@hsbt hsbt merged commit c053675 into ruby:master Sep 27, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants