Skip to content

Commit

Permalink
Merge pull request #23 from gmcgibbon/ms
Browse files Browse the repository at this point in the history
ms bin script
  • Loading branch information
gmcgibbon authored Dec 2, 2024
2 parents 65fc583 + dfdf87c commit 08c03f3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/ruby
# frozen_string_literal: true

require "benchmark"

class << Benchmark
def ms(&block)
1000 * realtime(&block)
end
end

system("") # warm up shelling out
cmd = ARGV.map { |arg| arg.empty? ? "\"\"" : arg }.join(" ")
ms = Benchmark.ms { system(cmd) }

puts "#{ms}ms"

0 comments on commit 08c03f3

Please sign in to comment.