SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. times = ARGV.map { |f| [f.split(?.).first, File.readlines(f).map { |l| l.split[-1].to_f }] }.to_h
  2.  
  3. def colour(s, rat)
  4.   code = if rat == 1
  5.     34
  6.   elsif rat <= 2
  7.     32
  8.   elsif rat <= 5
  9.     33
  10.   else
  11.     31
  12.   end
  13.   "\e[1;#{code}m#{s}\e[0m"
  14. end
  15.  
  16. puts '   ' + times.keys.map { |k| '%6s' % k }.join(' ')
  17. 25.times { |n|
  18.   left = '%2d ' % (n + 1)
  19.   mintime = times.values.map { |vs| vs[n] }.min
  20.   ratios = times.values.map { |vs| vs[n] / mintime }
  21.   puts left + ratios.map { |r| colour('%6.2f' % r, r) }.join(' ')
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top