module Async
def self.measure(*args, threshold: 1.0, &block)
def self.measure(*args, threshold: 1.0, &block) result = nil duration = Benchmark.realtime do result = yield end return result ensure if duration && duration > threshold warn "#{args.join(' ')} took #{duration}s" end end