benchmark 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c8a929d80c7226cb317950efed766404d6dff1f921c0c9235ac5c812bed298b
4
- data.tar.gz: 2f7a36ecb752ab4505fd7cbf731c8ae3b160972b2b500821e75243e2f7f8b7ae
3
+ metadata.gz: 71da3f4deaf010cbee21c6d4b962c8ae7741a9e1efe64de0f183bf34b4d27d8d
4
+ data.tar.gz: c4bb5fc6eca86edcad141451fab6e6f6f1cadd1d3fa5dfdfe73b174ff1b48e67
5
5
  SHA512:
6
- metadata.gz: 58043fc0c11da02f8abc4fcd0535eee0724d7950e0c593c8079077869c473e1c36a9dfd69b559e8761d1c79fc461f2cb2fcba68d8b3f16e4bdd40a2d1a90cba8
7
- data.tar.gz: 9e620a007cb7c9d7beaf15779cf160be1b4726fe49791a229048dd6d1730dba490e7ac1f9f614b9eb466b84eb6140b84634fcaa08c8b4d0c0e5e2176f68f972e
6
+ metadata.gz: da08f1963ba18421b6dda1f03f1c1ab196913b680de4289387f75b26845f8789c5320cd34dc5765d4ff488730eba5c1fb52673de6e657150dc3f0f73821335f5
7
+ data.tar.gz: 41eb1f1fa53b7da51feacda122f513e2a36a661a82c12f3e239ad384d1f96e090ae9cf412fdb1486b5b391add4c99d540261d980e792381f2954ec8b3f703cab
@@ -23,14 +23,14 @@ jobs:
23
23
 
24
24
  steps:
25
25
  - name: Harden Runner
26
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
26
+ uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
27
27
  with:
28
28
  egress-policy: audit
29
29
 
30
- - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
30
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31
31
 
32
32
  - name: Set up Ruby
33
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
33
+ uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
34
34
  with:
35
35
  bundler-cache: true
36
36
  ruby-version: ruby
@@ -43,4 +43,4 @@ jobs:
43
43
  tag_name="$(git describe --tags --abbrev=0)"
44
44
  gh release create "${tag_name}" --verify-tag --generate-notes
45
45
  env:
46
- GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
46
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -21,7 +21,7 @@ jobs:
21
21
  - { os: windows-latest, ruby: truffleruby }
22
22
  runs-on: ${{ matrix.os }}
23
23
  steps:
24
- - uses: actions/checkout@v4
24
+ - uses: actions/checkout@v5
25
25
  - name: Set up Ruby
26
26
  uses: ruby/setup-ruby@v1
27
27
  with:
data/lib/benchmark.rb CHANGED
@@ -122,7 +122,7 @@
122
122
 
123
123
  module Benchmark
124
124
 
125
- VERSION = "0.4.1"
125
+ VERSION = "0.5.0"
126
126
 
127
127
  BENCHMARK_VERSION = "2002-04-25" # :nodoc:
128
128
 
@@ -325,7 +325,20 @@ module Benchmark
325
325
  Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
326
326
  end
327
327
 
328
- module_function :benchmark, :measure, :realtime, :bm, :bmbm
328
+ #
329
+ # Returns the elapsed real time used to execute the given block.
330
+ # The unit of time is milliseconds.
331
+ #
332
+ # Benchmark.ms { "a" * 1_000_000_000 }
333
+ # #=> 509.8029999935534
334
+ #
335
+ def ms # :yield:
336
+ r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
337
+ yield
338
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) - r0
339
+ end
340
+
341
+ module_function :benchmark, :measure, :realtime, :ms, :bm, :bmbm
329
342
 
330
343
  #
331
344
  # A Job is a sequence of labelled blocks to be processed by the
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-05-30 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: a performance benchmarking library
14
13
  email:
@@ -37,7 +36,6 @@ licenses:
37
36
  metadata:
38
37
  homepage_uri: https://github.com/ruby/benchmark
39
38
  source_code_uri: https://github.com/ruby/benchmark
40
- post_install_message:
41
39
  rdoc_options: []
42
40
  require_paths:
43
41
  - lib
@@ -52,8 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
50
  - !ruby/object:Gem::Version
53
51
  version: '0'
54
52
  requirements: []
55
- rubygems_version: 3.5.11
56
- signing_key:
53
+ rubygems_version: 3.6.9
57
54
  specification_version: 4
58
55
  summary: a performance benchmarking library
59
56
  test_files: []