Method: DataMapper::Migration#say_with_time
- Defined in:
- lib/dm-migrations/migration.rb
#say_with_time(message, indent = 2) ⇒ Object
Time how long the block takes to run, and output it with the message.
207 208 209 210 211 212 213 |
# File 'lib/dm-migrations/migration.rb', line 207 def say_with_time(, indent = 2) say(, indent) result = nil time = Benchmark.measure { result = yield } say("-> %.4fs" % time.real, indent) result end |