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 +4 -4
- data/.github/workflows/push_gem.yml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/lib/benchmark.rb +15 -2
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71da3f4deaf010cbee21c6d4b962c8ae7741a9e1efe64de0f183bf34b4d27d8d
|
|
4
|
+
data.tar.gz: c4bb5fc6eca86edcad141451fab6e6f6f1cadd1d3fa5dfdfe73b174ff1b48e67
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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@
|
|
26
|
+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
27
27
|
with:
|
|
28
28
|
egress-policy: audit
|
|
29
29
|
|
|
30
|
-
- uses: actions/checkout@
|
|
30
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
31
31
|
|
|
32
32
|
- name: Set up Ruby
|
|
33
|
-
uses: ruby/setup-ruby@
|
|
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.
|
|
46
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.github/workflows/test.yml
CHANGED
data/lib/benchmark.rb
CHANGED
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
|
|
123
123
|
module Benchmark
|
|
124
124
|
|
|
125
|
-
VERSION = "0.
|
|
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
|
-
|
|
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
|
+
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:
|
|
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.
|
|
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: []
|