]> git.itanic.dy.fi Git - emerge-timer/commitdiff
Print total time spent emerging package
authorEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 21 May 2011 13:59:01 +0000 (16:59 +0300)
committerEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 21 May 2011 13:59:01 +0000 (16:59 +0300)
emerge-timer.py

index f5d7221f6b04523f89d9767930b40c757bd2411e..c4354a45d1f7385fb5599b7e6861e2aa78db16d3 100755 (executable)
@@ -74,6 +74,13 @@ def print_times(times):
     print "Average time", int(round(all_times/len(times)/60)), "min",
     print int(all_times/len(times)%60), "s"
 
+    total_hours = all_times/(60*60)
+    total_minutes = (all_times/(60*60) - int(total_hours))*60
+    total_seconds = (total_minutes - int(total_minutes))*60
+    print "In total spent", int(round(total_hours)), "h",
+    print int(round(total_minutes)), "min", int(round(total_seconds)),
+    print "s emerging", package
+
 
 for line in f:
     if package_name in line: