light_stopwatch 1.0.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 +7 -0
- data/lib/light_stopwatch.rb +23 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d15621b199d576ecf823ee8d4d00984c55321de2
|
4
|
+
data.tar.gz: f0270518459a01bc8b5a42fd6a4fa5b42bc70c60
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e7595e29cbedb78cea2f9a04e0f69b3b5751d4544689a67a18dea2627dbadab813d79993814513258a2fbae090bdbac49d760290aeacfccd57c708073af42c21
|
7
|
+
data.tar.gz: 52aa9c436d7fe1d4537232e15c6563ad4f5767e890ebeb55b49677f9db9d48e94d6bea898449a10c39a45426df7de926b104d99ed7f9047dafa2416f7bc1ee38
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module LightStopwatch
|
2
|
+
def get_time(&block)
|
3
|
+
LightStopwatch.get_time(&block)
|
4
|
+
end
|
5
|
+
|
6
|
+
def measure(&block)
|
7
|
+
LightStopwatch.measure(&block)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.get_time(&block)
|
11
|
+
start = Time.now
|
12
|
+
yield
|
13
|
+
stop = Time.now
|
14
|
+
|
15
|
+
stop - start
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.measure(&block)
|
19
|
+
puts "Operation took: #{get_time(&block)}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
LS = LightStopwatch
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: light_stopwatch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jan Renra Gloser
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- jan.renra.gloser@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/light_stopwatch.rb
|
21
|
+
homepage: https://github.com/renra/ruby-light_stopwatch
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.4.5.1
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Lightweight time-profiling utility
|
45
|
+
test_files: []
|