sorbet-result 1.1.0 → 1.3.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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.standard.yml +1 -1
  4. data/CHANGELOG.md +17 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +85 -68
  7. data/README.md +4 -4
  8. data/lib/typed/no_payload_on_failure_error.rb +8 -3
  9. data/lib/typed/result.rb +33 -3
  10. data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +4 -3
  11. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  12. data/sorbet/rbi/gems/cgi@0.5.0.rbi +2961 -0
  13. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  14. data/sorbet/rbi/gems/erb@4.0.4.rbi +910 -0
  15. data/sorbet/rbi/gems/{erubi@1.12.0.rbi → erubi@1.13.1.rbi} +25 -15
  16. data/sorbet/rbi/gems/{io-console@0.7.2.rbi → io-console@0.8.0.rbi} +1 -0
  17. data/sorbet/rbi/gems/{json@2.7.1.rbi → json@2.12.2.rbi} +736 -238
  18. data/sorbet/rbi/gems/{language_server-protocol@3.17.0.3.rbi → language_server-protocol@3.17.0.5.rbi} +12 -5
  19. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +1 -0
  20. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  21. data/sorbet/rbi/gems/{minitest@5.22.2.rbi → minitest@5.25.5.rbi} +326 -308
  22. data/sorbet/rbi/gems/netrc@0.11.0.rbi +1 -0
  23. data/sorbet/rbi/gems/{parallel@1.24.0.rbi → parallel@1.27.0.rbi} +32 -21
  24. data/sorbet/rbi/gems/{parser@3.3.0.5.rbi → parser@3.3.8.0.rbi} +448 -385
  25. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  26. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  27. data/sorbet/rbi/gems/prism@1.4.0.rbi +41732 -0
  28. data/sorbet/rbi/gems/{psych@5.1.2.rbi → psych@5.2.6.rbi} +974 -236
  29. data/sorbet/rbi/gems/{racc@1.7.3.rbi → racc@1.8.1.rbi} +38 -33
  30. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +1 -0
  31. data/sorbet/rbi/gems/{rake@13.1.0.rbi → rake@13.3.0.rbi} +62 -58
  32. data/sorbet/rbi/gems/rbi@0.3.6.rbi +6893 -0
  33. data/sorbet/rbi/gems/rbs@3.9.4.rbi +6976 -0
  34. data/sorbet/rbi/gems/{regexp_parser@2.9.0.rbi → regexp_parser@2.10.0.rbi} +196 -172
  35. data/sorbet/rbi/gems/{reline@0.4.2.rbi → reline@0.6.1.rbi} +1 -0
  36. data/sorbet/rbi/gems/{rubocop-ast@1.30.0.rbi → rubocop-ast@1.45.1.rbi} +1673 -958
  37. data/sorbet/rbi/gems/{rubocop-performance@1.20.2.rbi → rubocop-performance@1.25.0.rbi} +1 -0
  38. data/sorbet/rbi/gems/{rubocop-sorbet@0.7.7.rbi → rubocop-sorbet@0.9.0.rbi} +1 -0
  39. data/sorbet/rbi/gems/{rubocop@1.60.2.rbi → rubocop@1.75.8.rbi} +9990 -5267
  40. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1 -0
  41. data/sorbet/rbi/gems/spoom@1.6.1.rbi +7274 -0
  42. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +1 -0
  43. data/sorbet/rbi/gems/{standard-performance@1.3.1.rbi → standard-performance@1.8.0.rbi} +1 -0
  44. data/sorbet/rbi/gems/{standard-sorbet@0.0.2.rbi → standard-sorbet@0.0.3.rbi} +1 -0
  45. data/sorbet/rbi/gems/{standard@1.34.0.rbi → standard@1.50.0.rbi} +182 -97
  46. data/sorbet/rbi/gems/{stringio@3.1.0.rbi → stringio@3.1.7.rbi} +1 -0
  47. data/sorbet/rbi/gems/{tapioca@0.12.0.rbi → tapioca@0.16.11.rbi} +489 -364
  48. data/sorbet/rbi/gems/{thor@1.3.0.rbi → thor@1.3.2.rbi} +114 -81
  49. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  50. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  51. data/sorbet/rbi/gems/{yard-sorbet@0.8.1.rbi → yard-sorbet@0.9.0.rbi} +36 -29
  52. data/sorbet/rbi/gems/{yard@0.9.34.rbi → yard@0.9.37.rbi} +430 -270
  53. metadata +46 -55
  54. data/.tool-versions +0 -1
  55. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +0 -951
  56. data/sorbet/rbi/gems/prism@0.24.0.rbi +0 -31040
  57. data/sorbet/rbi/gems/rbi@0.1.9.rbi +0 -3006
  58. data/sorbet/rbi/gems/rexml@3.2.6.rbi +0 -4781
  59. data/sorbet/rbi/gems/spoom@1.2.4.rbi +0 -3777
  60. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +0 -23133
  61. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +0 -65
@@ -0,0 +1,619 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `benchmark` gem.
5
+ # Please instead update this file by running `bin/tapioca gem benchmark`.
6
+
7
+
8
+ # The Benchmark module provides methods to measure and report the time
9
+ # used to execute Ruby code.
10
+ #
11
+ # * Measure the time to construct the string given by the expression
12
+ # <code>"a"*1_000_000_000</code>:
13
+ #
14
+ # require 'benchmark'
15
+ #
16
+ # puts Benchmark.measure { "a"*1_000_000_000 }
17
+ #
18
+ # On my machine (OSX 10.8.3 on i5 1.7 GHz) this generates:
19
+ #
20
+ # 0.350000 0.400000 0.750000 ( 0.835234)
21
+ #
22
+ # This report shows the user CPU time, system CPU time, the total time
23
+ # (sum of user CPU time, system CPU time, children's user CPU time,
24
+ # and children's system CPU time), and the elapsed real time. The unit
25
+ # of time is seconds.
26
+ #
27
+ # * Do some experiments sequentially using the #bm method:
28
+ #
29
+ # require 'benchmark'
30
+ #
31
+ # n = 5000000
32
+ # Benchmark.bm do |x|
33
+ # x.report { for i in 1..n; a = "1"; end }
34
+ # x.report { n.times do ; a = "1"; end }
35
+ # x.report { 1.upto(n) do ; a = "1"; end }
36
+ # end
37
+ #
38
+ # The result:
39
+ #
40
+ # user system total real
41
+ # 1.010000 0.000000 1.010000 ( 1.014479)
42
+ # 1.000000 0.000000 1.000000 ( 0.998261)
43
+ # 0.980000 0.000000 0.980000 ( 0.981335)
44
+ #
45
+ # * Continuing the previous example, put a label in each report:
46
+ #
47
+ # require 'benchmark'
48
+ #
49
+ # n = 5000000
50
+ # Benchmark.bm(7) do |x|
51
+ # x.report("for:") { for i in 1..n; a = "1"; end }
52
+ # x.report("times:") { n.times do ; a = "1"; end }
53
+ # x.report("upto:") { 1.upto(n) do ; a = "1"; end }
54
+ # end
55
+ #
56
+ # The result:
57
+ #
58
+ # user system total real
59
+ # for: 1.010000 0.000000 1.010000 ( 1.015688)
60
+ # times: 1.000000 0.000000 1.000000 ( 1.003611)
61
+ # upto: 1.030000 0.000000 1.030000 ( 1.028098)
62
+ #
63
+ # * The times for some benchmarks depend on the order in which items
64
+ # are run. These differences are due to the cost of memory
65
+ # allocation and garbage collection. To avoid these discrepancies,
66
+ # the #bmbm method is provided. For example, to compare ways to
67
+ # sort an array of floats:
68
+ #
69
+ # require 'benchmark'
70
+ #
71
+ # array = (1..1000000).map { rand }
72
+ #
73
+ # Benchmark.bmbm do |x|
74
+ # x.report("sort!") { array.dup.sort! }
75
+ # x.report("sort") { array.dup.sort }
76
+ # end
77
+ #
78
+ # The result:
79
+ #
80
+ # Rehearsal -----------------------------------------
81
+ # sort! 1.490000 0.010000 1.500000 ( 1.490520)
82
+ # sort 1.460000 0.000000 1.460000 ( 1.463025)
83
+ # -------------------------------- total: 2.960000sec
84
+ #
85
+ # user system total real
86
+ # sort! 1.460000 0.000000 1.460000 ( 1.460465)
87
+ # sort 1.450000 0.010000 1.460000 ( 1.448327)
88
+ #
89
+ # * Report statistics of sequential experiments with unique labels,
90
+ # using the #benchmark method:
91
+ #
92
+ # require 'benchmark'
93
+ # include Benchmark # we need the CAPTION and FORMAT constants
94
+ #
95
+ # n = 5000000
96
+ # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x|
97
+ # tf = x.report("for:") { for i in 1..n; a = "1"; end }
98
+ # tt = x.report("times:") { n.times do ; a = "1"; end }
99
+ # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
100
+ # [tf+tt+tu, (tf+tt+tu)/3]
101
+ # end
102
+ #
103
+ # The result:
104
+ #
105
+ # user system total real
106
+ # for: 0.950000 0.000000 0.950000 ( 0.952039)
107
+ # times: 0.980000 0.000000 0.980000 ( 0.984938)
108
+ # upto: 0.950000 0.000000 0.950000 ( 0.946787)
109
+ # >total: 2.880000 0.000000 2.880000 ( 2.883764)
110
+ # >avg: 0.960000 0.000000 0.960000 ( 0.961255)
111
+ #
112
+ # source://benchmark//lib/benchmark.rb#123
113
+ module Benchmark
114
+ private
115
+
116
+ # Invokes the block with a Benchmark::Report object, which
117
+ # may be used to collect and report on the results of individual
118
+ # benchmark tests. Reserves +label_width+ leading spaces for
119
+ # labels on each line. Prints +caption+ at the top of the
120
+ # report, and uses +format+ to format each line.
121
+ # (Note: +caption+ must contain a terminating newline character,
122
+ # see the default Benchmark::Tms::CAPTION for an example.)
123
+ #
124
+ # Returns an array of Benchmark::Tms objects.
125
+ #
126
+ # If the block returns an array of
127
+ # Benchmark::Tms objects, these will be used to format
128
+ # additional lines of output. If +labels+ parameter are
129
+ # given, these are used to label these extra lines.
130
+ #
131
+ # _Note_: Other methods provide a simpler interface to this one, and are
132
+ # suitable for nearly all benchmarking requirements. See the examples in
133
+ # Benchmark, and the #bm and #bmbm methods.
134
+ #
135
+ # Example:
136
+ #
137
+ # require 'benchmark'
138
+ # include Benchmark # we need the CAPTION and FORMAT constants
139
+ #
140
+ # n = 5000000
141
+ # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x|
142
+ # tf = x.report("for:") { for i in 1..n; a = "1"; end }
143
+ # tt = x.report("times:") { n.times do ; a = "1"; end }
144
+ # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
145
+ # [tf+tt+tu, (tf+tt+tu)/3]
146
+ # end
147
+ #
148
+ # Generates:
149
+ #
150
+ # user system total real
151
+ # for: 0.970000 0.000000 0.970000 ( 0.970493)
152
+ # times: 0.990000 0.000000 0.990000 ( 0.989542)
153
+ # upto: 0.970000 0.000000 0.970000 ( 0.972854)
154
+ # >total: 2.930000 0.000000 2.930000 ( 2.932889)
155
+ # >avg: 0.976667 0.000000 0.976667 ( 0.977630)
156
+ #
157
+ # source://benchmark//lib/benchmark.rb#171
158
+ def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end
159
+
160
+ # A simple interface to the #benchmark method, #bm generates sequential
161
+ # reports with labels. +label_width+ and +labels+ parameters have the same
162
+ # meaning as for #benchmark.
163
+ #
164
+ # require 'benchmark'
165
+ #
166
+ # n = 5000000
167
+ # Benchmark.bm(7) do |x|
168
+ # x.report("for:") { for i in 1..n; a = "1"; end }
169
+ # x.report("times:") { n.times do ; a = "1"; end }
170
+ # x.report("upto:") { 1.upto(n) do ; a = "1"; end }
171
+ # end
172
+ #
173
+ # Generates:
174
+ #
175
+ # user system total real
176
+ # for: 0.960000 0.000000 0.960000 ( 0.957966)
177
+ # times: 0.960000 0.000000 0.960000 ( 0.960423)
178
+ # upto: 0.950000 0.000000 0.950000 ( 0.954864)
179
+ #
180
+ # source://benchmark//lib/benchmark.rb#216
181
+ def bm(label_width = T.unsafe(nil), *labels, &blk); end
182
+
183
+ # Sometimes benchmark results are skewed because code executed
184
+ # earlier encounters different garbage collection overheads than
185
+ # that run later. #bmbm attempts to minimize this effect by running
186
+ # the tests twice, the first time as a rehearsal in order to get the
187
+ # runtime environment stable, the second time for
188
+ # real. GC.start is executed before the start of each of
189
+ # the real timings; the cost of this is not included in the
190
+ # timings. In reality, though, there's only so much that #bmbm can
191
+ # do, and the results are not guaranteed to be isolated from garbage
192
+ # collection and other effects.
193
+ #
194
+ # Because #bmbm takes two passes through the tests, it can
195
+ # calculate the required label width.
196
+ #
197
+ # require 'benchmark'
198
+ #
199
+ # array = (1..1000000).map { rand }
200
+ #
201
+ # Benchmark.bmbm do |x|
202
+ # x.report("sort!") { array.dup.sort! }
203
+ # x.report("sort") { array.dup.sort }
204
+ # end
205
+ #
206
+ # Generates:
207
+ #
208
+ # Rehearsal -----------------------------------------
209
+ # sort! 1.440000 0.010000 1.450000 ( 1.446833)
210
+ # sort 1.440000 0.000000 1.440000 ( 1.448257)
211
+ # -------------------------------- total: 2.890000sec
212
+ #
213
+ # user system total real
214
+ # sort! 1.460000 0.000000 1.460000 ( 1.458065)
215
+ # sort 1.450000 0.000000 1.450000 ( 1.455963)
216
+ #
217
+ # #bmbm yields a Benchmark::Job object and returns an array of
218
+ # Benchmark::Tms objects.
219
+ #
220
+ # source://benchmark//lib/benchmark.rb#258
221
+ def bmbm(width = T.unsafe(nil)); end
222
+
223
+ # Returns the time used to execute the given block as a
224
+ # Benchmark::Tms object. Takes +label+ option.
225
+ #
226
+ # require 'benchmark'
227
+ #
228
+ # n = 1000000
229
+ #
230
+ # time = Benchmark.measure do
231
+ # n.times { a = "1" }
232
+ # end
233
+ # puts time
234
+ #
235
+ # Generates:
236
+ #
237
+ # 0.220000 0.000000 0.220000 ( 0.227313)
238
+ #
239
+ # source://benchmark//lib/benchmark.rb#303
240
+ def measure(label = T.unsafe(nil)); end
241
+
242
+ # Returns the elapsed real time used to execute the given block.
243
+ # The unit of time is seconds.
244
+ #
245
+ # Benchmark.realtime { "a" * 1_000_000_000 }
246
+ # #=> 0.5098029999935534
247
+ #
248
+ # source://benchmark//lib/benchmark.rb#322
249
+ def realtime; end
250
+
251
+ class << self
252
+ # Invokes the block with a Benchmark::Report object, which
253
+ # may be used to collect and report on the results of individual
254
+ # benchmark tests. Reserves +label_width+ leading spaces for
255
+ # labels on each line. Prints +caption+ at the top of the
256
+ # report, and uses +format+ to format each line.
257
+ # (Note: +caption+ must contain a terminating newline character,
258
+ # see the default Benchmark::Tms::CAPTION for an example.)
259
+ #
260
+ # Returns an array of Benchmark::Tms objects.
261
+ #
262
+ # If the block returns an array of
263
+ # Benchmark::Tms objects, these will be used to format
264
+ # additional lines of output. If +labels+ parameter are
265
+ # given, these are used to label these extra lines.
266
+ #
267
+ # _Note_: Other methods provide a simpler interface to this one, and are
268
+ # suitable for nearly all benchmarking requirements. See the examples in
269
+ # Benchmark, and the #bm and #bmbm methods.
270
+ #
271
+ # Example:
272
+ #
273
+ # require 'benchmark'
274
+ # include Benchmark # we need the CAPTION and FORMAT constants
275
+ #
276
+ # n = 5000000
277
+ # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x|
278
+ # tf = x.report("for:") { for i in 1..n; a = "1"; end }
279
+ # tt = x.report("times:") { n.times do ; a = "1"; end }
280
+ # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
281
+ # [tf+tt+tu, (tf+tt+tu)/3]
282
+ # end
283
+ #
284
+ # Generates:
285
+ #
286
+ # user system total real
287
+ # for: 0.970000 0.000000 0.970000 ( 0.970493)
288
+ # times: 0.990000 0.000000 0.990000 ( 0.989542)
289
+ # upto: 0.970000 0.000000 0.970000 ( 0.972854)
290
+ # >total: 2.930000 0.000000 2.930000 ( 2.932889)
291
+ # >avg: 0.976667 0.000000 0.976667 ( 0.977630)
292
+ #
293
+ # source://benchmark//lib/benchmark.rb#171
294
+ def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end
295
+
296
+ # A simple interface to the #benchmark method, #bm generates sequential
297
+ # reports with labels. +label_width+ and +labels+ parameters have the same
298
+ # meaning as for #benchmark.
299
+ #
300
+ # require 'benchmark'
301
+ #
302
+ # n = 5000000
303
+ # Benchmark.bm(7) do |x|
304
+ # x.report("for:") { for i in 1..n; a = "1"; end }
305
+ # x.report("times:") { n.times do ; a = "1"; end }
306
+ # x.report("upto:") { 1.upto(n) do ; a = "1"; end }
307
+ # end
308
+ #
309
+ # Generates:
310
+ #
311
+ # user system total real
312
+ # for: 0.960000 0.000000 0.960000 ( 0.957966)
313
+ # times: 0.960000 0.000000 0.960000 ( 0.960423)
314
+ # upto: 0.950000 0.000000 0.950000 ( 0.954864)
315
+ #
316
+ # source://benchmark//lib/benchmark.rb#216
317
+ def bm(label_width = T.unsafe(nil), *labels, &blk); end
318
+
319
+ # Sometimes benchmark results are skewed because code executed
320
+ # earlier encounters different garbage collection overheads than
321
+ # that run later. #bmbm attempts to minimize this effect by running
322
+ # the tests twice, the first time as a rehearsal in order to get the
323
+ # runtime environment stable, the second time for
324
+ # real. GC.start is executed before the start of each of
325
+ # the real timings; the cost of this is not included in the
326
+ # timings. In reality, though, there's only so much that #bmbm can
327
+ # do, and the results are not guaranteed to be isolated from garbage
328
+ # collection and other effects.
329
+ #
330
+ # Because #bmbm takes two passes through the tests, it can
331
+ # calculate the required label width.
332
+ #
333
+ # require 'benchmark'
334
+ #
335
+ # array = (1..1000000).map { rand }
336
+ #
337
+ # Benchmark.bmbm do |x|
338
+ # x.report("sort!") { array.dup.sort! }
339
+ # x.report("sort") { array.dup.sort }
340
+ # end
341
+ #
342
+ # Generates:
343
+ #
344
+ # Rehearsal -----------------------------------------
345
+ # sort! 1.440000 0.010000 1.450000 ( 1.446833)
346
+ # sort 1.440000 0.000000 1.440000 ( 1.448257)
347
+ # -------------------------------- total: 2.890000sec
348
+ #
349
+ # user system total real
350
+ # sort! 1.460000 0.000000 1.460000 ( 1.458065)
351
+ # sort 1.450000 0.000000 1.450000 ( 1.455963)
352
+ #
353
+ # #bmbm yields a Benchmark::Job object and returns an array of
354
+ # Benchmark::Tms objects.
355
+ #
356
+ # source://benchmark//lib/benchmark.rb#258
357
+ def bmbm(width = T.unsafe(nil)); end
358
+
359
+ # Returns the time used to execute the given block as a
360
+ # Benchmark::Tms object. Takes +label+ option.
361
+ #
362
+ # require 'benchmark'
363
+ #
364
+ # n = 1000000
365
+ #
366
+ # time = Benchmark.measure do
367
+ # n.times { a = "1" }
368
+ # end
369
+ # puts time
370
+ #
371
+ # Generates:
372
+ #
373
+ # 0.220000 0.000000 0.220000 ( 0.227313)
374
+ #
375
+ # source://benchmark//lib/benchmark.rb#303
376
+ def measure(label = T.unsafe(nil)); end
377
+
378
+ # Returns the elapsed real time used to execute the given block.
379
+ # The unit of time is seconds.
380
+ #
381
+ # Benchmark.realtime { "a" * 1_000_000_000 }
382
+ # #=> 0.5098029999935534
383
+ #
384
+ # source://benchmark//lib/benchmark.rb#322
385
+ def realtime; end
386
+ end
387
+ end
388
+
389
+ # A Job is a sequence of labelled blocks to be processed by the
390
+ # Benchmark.bmbm method. It is of little direct interest to the user.
391
+ #
392
+ # source://benchmark//lib/benchmark.rb#334
393
+ class Benchmark::Job
394
+ # Returns an initialized Job instance.
395
+ # Usually, one doesn't call this method directly, as new
396
+ # Job objects are created by the #bmbm method.
397
+ # +width+ is a initial value for the label offset used in formatting;
398
+ # the #bmbm method passes its +width+ argument to this constructor.
399
+ #
400
+ # @return [Job] a new instance of Job
401
+ #
402
+ # source://benchmark//lib/benchmark.rb#342
403
+ def initialize(width); end
404
+
405
+ # Registers the given label and block pair in the job list.
406
+ #
407
+ # @raise [ArgumentError]
408
+ #
409
+ # source://benchmark//lib/benchmark.rb#350
410
+ def item(label = T.unsafe(nil), &blk); end
411
+
412
+ # An array of 2-element arrays, consisting of label and block pairs.
413
+ #
414
+ # source://benchmark//lib/benchmark.rb#362
415
+ def list; end
416
+
417
+ # Registers the given label and block pair in the job list.
418
+ #
419
+ # @raise [ArgumentError]
420
+ #
421
+ # source://benchmark//lib/benchmark.rb#350
422
+ def report(label = T.unsafe(nil), &blk); end
423
+
424
+ # Length of the widest label in the #list.
425
+ #
426
+ # source://benchmark//lib/benchmark.rb#365
427
+ def width; end
428
+ end
429
+
430
+ # This class is used by the Benchmark.benchmark and Benchmark.bm methods.
431
+ # It is of little direct interest to the user.
432
+ #
433
+ # source://benchmark//lib/benchmark.rb#372
434
+ class Benchmark::Report
435
+ # Returns an initialized Report instance.
436
+ # Usually, one doesn't call this method directly, as new
437
+ # Report objects are created by the #benchmark and #bm methods.
438
+ # +width+ and +format+ are the label offset and
439
+ # format string used by Tms#format.
440
+ #
441
+ # @return [Report] a new instance of Report
442
+ #
443
+ # source://benchmark//lib/benchmark.rb#380
444
+ def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end
445
+
446
+ # An array of Benchmark::Tms objects representing each item.
447
+ #
448
+ # source://benchmark//lib/benchmark.rb#399
449
+ def format; end
450
+
451
+ # Prints the +label+ and measured time for the block,
452
+ # formatted by +format+. See Tms#format for the
453
+ # formatting rules.
454
+ #
455
+ # source://benchmark//lib/benchmark.rb#389
456
+ def item(label = T.unsafe(nil), *format, &blk); end
457
+
458
+ # An array of Benchmark::Tms objects representing each item.
459
+ #
460
+ # source://benchmark//lib/benchmark.rb#399
461
+ def list; end
462
+
463
+ # Prints the +label+ and measured time for the block,
464
+ # formatted by +format+. See Tms#format for the
465
+ # formatting rules.
466
+ #
467
+ # source://benchmark//lib/benchmark.rb#389
468
+ def report(label = T.unsafe(nil), *format, &blk); end
469
+
470
+ # An array of Benchmark::Tms objects representing each item.
471
+ #
472
+ # source://benchmark//lib/benchmark.rb#399
473
+ def width; end
474
+ end
475
+
476
+ # A data object, representing the times associated with a benchmark
477
+ # measurement.
478
+ #
479
+ # source://benchmark//lib/benchmark.rb#408
480
+ class Benchmark::Tms
481
+ # Returns an initialized Tms object which has
482
+ # +utime+ as the user CPU time, +stime+ as the system CPU time,
483
+ # +cutime+ as the children's user CPU time, +cstime+ as the children's
484
+ # system CPU time, +real+ as the elapsed real time and +label+ as the label.
485
+ #
486
+ # @return [Tms] a new instance of Tms
487
+ #
488
+ # source://benchmark//lib/benchmark.rb#443
489
+ def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end
490
+
491
+ # Returns a new Tms object obtained by memberwise multiplication
492
+ # of the individual times for this Tms object by +x+.
493
+ #
494
+ # source://benchmark//lib/benchmark.rb#491
495
+ def *(x); end
496
+
497
+ # Returns a new Tms object obtained by memberwise summation
498
+ # of the individual times for this Tms object with those of the +other+
499
+ # Tms object.
500
+ # This method and #/() are useful for taking statistics.
501
+ #
502
+ # source://benchmark//lib/benchmark.rb#478
503
+ def +(other); end
504
+
505
+ # Returns a new Tms object obtained by memberwise subtraction
506
+ # of the individual times for the +other+ Tms object from those of this
507
+ # Tms object.
508
+ #
509
+ # source://benchmark//lib/benchmark.rb#485
510
+ def -(other); end
511
+
512
+ # Returns a new Tms object obtained by memberwise division
513
+ # of the individual times for this Tms object by +x+.
514
+ # This method and #+() are useful for taking statistics.
515
+ #
516
+ # source://benchmark//lib/benchmark.rb#498
517
+ def /(x); end
518
+
519
+ # Returns a new Tms object whose times are the sum of the times for this
520
+ # Tms object, plus the time required to execute the code block (+blk+).
521
+ #
522
+ # source://benchmark//lib/benchmark.rb#452
523
+ def add(&blk); end
524
+
525
+ # An in-place version of #add.
526
+ # Changes the times of this Tms object by making it the sum of the times
527
+ # for this Tms object, plus the time required to execute
528
+ # the code block (+blk+).
529
+ #
530
+ # source://benchmark//lib/benchmark.rb#462
531
+ def add!(&blk); end
532
+
533
+ # System CPU time of children
534
+ #
535
+ # source://benchmark//lib/benchmark.rb#426
536
+ def cstime; end
537
+
538
+ # User CPU time of children
539
+ #
540
+ # source://benchmark//lib/benchmark.rb#423
541
+ def cutime; end
542
+
543
+ # Returns the contents of this Tms object as
544
+ # a formatted string, according to a +format+ string
545
+ # like that passed to Kernel.format. In addition, #format
546
+ # accepts the following extensions:
547
+ #
548
+ # <tt>%u</tt>:: Replaced by the user CPU time, as reported by Tms#utime.
549
+ # <tt>%y</tt>:: Replaced by the system CPU time, as reported by Tms#stime (Mnemonic: y of "s*y*stem")
550
+ # <tt>%U</tt>:: Replaced by the children's user CPU time, as reported by Tms#cutime
551
+ # <tt>%Y</tt>:: Replaced by the children's system CPU time, as reported by Tms#cstime
552
+ # <tt>%t</tt>:: Replaced by the total CPU time, as reported by Tms#total
553
+ # <tt>%r</tt>:: Replaced by the elapsed real time, as reported by Tms#real
554
+ # <tt>%n</tt>:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame")
555
+ #
556
+ # If +format+ is not given, FORMAT is used as default value, detailing the
557
+ # user, system, total and real elapsed time.
558
+ #
559
+ # source://benchmark//lib/benchmark.rb#517
560
+ def format(format = T.unsafe(nil), *args); end
561
+
562
+ # Label
563
+ #
564
+ # source://benchmark//lib/benchmark.rb#435
565
+ def label; end
566
+
567
+ # Elapsed real time
568
+ #
569
+ # source://benchmark//lib/benchmark.rb#429
570
+ def real; end
571
+
572
+ # System CPU time
573
+ #
574
+ # source://benchmark//lib/benchmark.rb#420
575
+ def stime; end
576
+
577
+ # Returns a new 6-element array, consisting of the
578
+ # label, user CPU time, system CPU time, children's
579
+ # user CPU time, children's system CPU time and elapsed
580
+ # real time.
581
+ #
582
+ # source://benchmark//lib/benchmark.rb#542
583
+ def to_a; end
584
+
585
+ # Returns a hash containing the same data as `to_a`.
586
+ #
587
+ # source://benchmark//lib/benchmark.rb#549
588
+ def to_h; end
589
+
590
+ # Same as #format.
591
+ #
592
+ # source://benchmark//lib/benchmark.rb#532
593
+ def to_s; end
594
+
595
+ # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+
596
+ #
597
+ # source://benchmark//lib/benchmark.rb#432
598
+ def total; end
599
+
600
+ # User CPU time
601
+ #
602
+ # source://benchmark//lib/benchmark.rb#417
603
+ def utime; end
604
+
605
+ protected
606
+
607
+ # Returns a new Tms object obtained by memberwise operation +op+
608
+ # of the individual times for this Tms object with those of the other
609
+ # Tms object (+x+).
610
+ #
611
+ # +op+ can be a mathematical operation such as <tt>+</tt>, <tt>-</tt>,
612
+ # <tt>*</tt>, <tt>/</tt>
613
+ #
614
+ # source://benchmark//lib/benchmark.rb#570
615
+ def memberwise(op, x); end
616
+ end
617
+
618
+ # source://benchmark//lib/benchmark.rb#125
619
+ Benchmark::VERSION = T.let(T.unsafe(nil), String)