#!/usr/local/bin/ruby # Compute mean process turn-around time for list of run lengths. if ARGV.empty? $stderr.puts "Usage #{File::basename($0)} [[] ...]" exit 64 end n = t = tt = 0 ARGV.each do |a| n+= 1 t+= a.to_i tt+= t end puts (tt / n)