Skip to content

Instantly share code, notes, and snippets.

@tekkub
Created June 3, 2010 08:14
Show Gist options
  • Select an option

  • Save tekkub/423628 to your computer and use it in GitHub Desktop.

Select an option

Save tekkub/423628 to your computer and use it in GitHub Desktop.

Revisions

  1. tekkub created this gist Jun 3, 2010.
    10 changes: 10 additions & 0 deletions disk_throughput.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/usr/bin/env ruby

    f = ARGV.first

    size = File.size f
    puts "Reading #{size/1024/1024} MiB"
    t = Time.now
    File.read f
    total_time = Time.now - t
    puts "%.1f sec - %.2f MiB/sec" % [total_time, size/1024/1024/total_time]