arrs = [6, 5, 3, 1, 3, 4, 3, 8, 9, 10]
t0 = Time.now
1.upto(10000).each { |v| arrs << [*-10..10].sample }
cal_i = 0
arr_size = arrs.size
max_diff_val = nil
min_val = nil
t1 = Time.now
arrs.each_with_index do |val, index|
  min_val = val if index == 0
  max_diff_val = val - min_val
  min_val = val if val < min_val
  cal_i += 1
end

t2 = Time.now
puts max_diff_val
puts min_val
puts cal_i
puts t0.strftime("%F %T")
puts t1.strftime("%F %T")
puts t2.strftime("%F %T")
puts (t2 - t1)