summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/util.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index a157ecf79..b3ad8ec39 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -345,10 +345,10 @@ module Util
if Puppet::Log.sendlevel?(level)
result = nil
seconds = Benchmark.realtime {
- result = yield
+ yield
}
object.send(level, msg + (" in %0.2f seconds" % seconds))
- result
+ return seconds
else
yield
end
@@ -399,6 +399,16 @@ module Util
0
end
end
+
+ # Just benchmark, with no logging.
+ def thinmark
+ seconds = Benchmark.realtime {
+ yield
+ }
+
+ return seconds
+ end
+
module_function :memory
end
end