]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
build-perf-bisect: improve human-readable time format a bit
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 1 Sep 2016 08:10:22 +0000 (11:10 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 6 Oct 2016 05:51:46 +0000 (08:51 +0300)
Don't print 'hours' if it's 0.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
build-perf-bisect.sh

index 021271677eb2768ca29b8531e17bbebdaac8b930..99adb4280b09c29c71f5e1a875f93a6c475c7be8 100755 (executable)
@@ -111,7 +111,11 @@ s_to_hms () {
     _h=`echo -e "scale=0\n$1 / 3600" | bc`
     _m=`echo -e "scale=0\n($1 % 3600) / 60" | bc`
     _s=`echo "$1 % 60" | bc`
-    printf "%d:%02d:%05.2f" $_h $_m $_s
+    if [ $_h -eq 0 ]; then
+        printf "%d:%05.2f" $_m $_s
+    else
+        printf "%d:%02d:%05.2f" $_h $_m $_s
+    fi
 }
 
 kib_to_gib () {