fat_core 5.6.1 → 7.0.1

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.
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fat_core/numeric'
4
-
5
- module Kernel
6
- # Run the given block and report the time it took to execute in
7
- # hour-minute-second form.
8
- #
9
- # @example
10
- # result = time_it 'Fibbonacci' do
11
- # Fibbonacci.fib(30)
12
- # end
13
- # puts "For 30 its #{result}"
14
- # => "Ran Fibonacci in 30:23"
15
- #
16
- # @param name [String, #to_s] an optional name to use for block in timing
17
- # message.
18
- # @return [Object] whatever the block returns
19
- def time_it(name = 'block', &block)
20
- start = Time.now
21
- result = yield block
22
- run_time = Time.now - start
23
- puts "Ran #{name} in #{run_time.secs_to_hms}"
24
- result
25
- end
26
- end