walltime 0.0.6 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/version.rb +2 -2
- data/lib/walltime.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb653022ecae9dab1cfcd0ef4484c525cc70b52b
|
4
|
+
data.tar.gz: ba0e8a5a71f0f23d1aac73053edbe1ae719c449f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6744bb56b7ea65a7fe1448a317fae2098fa988d843c9fb60e1a8afb7f28ed9d5993571bd7db802c2ea15256802a479a971dae3217bdb7ecdce981dfed8856531
|
7
|
+
data.tar.gz: 9af5ab2459444b3361580fefd5adf42c545aea20468c2bc0c741fdab2b4de0ea8f53402cc15b7822877b7203e6acb249c86f0dca592de131ef63eacd810d4ea5
|
data/lib/version.rb
CHANGED
data/lib/walltime.rb
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
|
11
11
|
module NumTools
|
12
12
|
|
13
|
+
# Implement more if you wish only interested in round myself right now.
|
13
14
|
def random_between(min, max); min+rand(max); end
|
14
15
|
|
15
16
|
def self.define_component(name)
|
@@ -66,5 +67,15 @@ class Stopwatch
|
|
66
67
|
intervalh
|
67
68
|
end
|
68
69
|
end
|
70
|
+
|
71
|
+
def start(&block)
|
72
|
+
watch('start')
|
73
|
+
block.call
|
74
|
+
end
|
75
|
+
|
76
|
+
def stop(&block)
|
77
|
+
block.call
|
78
|
+
watch('stop')
|
79
|
+
end
|
69
80
|
|
70
81
|
end
|