From df7554610fdaed78a3ae1116384a162e5e34ddd6 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 15 Jan 2023 15:17:15 -0800 Subject: Show which event each $horiz row is for at beginning and end of line. --- pt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pt b/pt index c17d902..e3799c6 100755 --- a/pt +++ b/pt @@ -77,11 +77,12 @@ end flatten($hier) rwidth = $order.map { | x | x.to_s.size }.max +rwidth = [rwidth, 3].max $horiz.keys.sort.each do | occ | - $stdout.write(" " * rwidth + " #{$horiz[occ].ljust($maxtime)}") + $stdout.write("#{occ}:" + " " * (rwidth - 2) + " #{$horiz[occ].ljust($maxtime)}") count = $horiz[occ].delete(" ").size - $stdout.write(" #{($maxtime.to_f / count.to_f).round(2).to_s.rjust(10)} cyc/evt #{(count.to_f / $maxtime.to_f).round(2).to_s.rjust(10)} evt/cyc\n") + $stdout.write(" :#{occ} #{($maxtime.to_f / count.to_f).round(2).to_s.rjust(10)} cyc/evt #{(count.to_f / $maxtime.to_f).round(2).to_s.rjust(10)} evt/cyc\n") end $stdout.write("\n") -- cgit v1.2.3