Skip to content

Commit cd13108

Browse files
committed
finished performance_monitor exercise
1 parent db0496d commit cd13108

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def measure(n = 1)
2+
dt = 0
3+
n.times do
4+
t1 = Time.now
5+
#puts t1
6+
yield
7+
t2 = Time.now
8+
#puts t2
9+
dt += t2 - t1
10+
end
11+
dt /= n
12+
end

0 commit comments

Comments
 (0)