From 68534a29d68026a2fb0628de7220be8c736a45b5 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 3 Jan 2020 14:43:57 -0800 Subject: [PATCH] Don't print critical path parallelism ratio if elapsed time is 0. Test: m nothing, examine out/soong.log Change-Id: Ib23902c703d306337b2a5150d6d63b1e3d0f95b3 --- ui/status/critical_path.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/status/critical_path.go b/ui/status/critical_path.go index 444327ba4..8065c60f0 100644 --- a/ui/status/critical_path.go +++ b/ui/status/critical_path.go @@ -112,8 +112,10 @@ func (cp *criticalPath) Flush() { if !cp.start.IsZero() { elapsedTime := cp.end.Sub(cp.start).Round(time.Second) cp.log.Verbosef("elapsed time %s", elapsedTime.String()) - cp.log.Verbosef("perfect parallelism ratio %d%%", - int(float64(criticalTime)/float64(elapsedTime)*100)) + if elapsedTime > 0 { + cp.log.Verbosef("perfect parallelism ratio %d%%", + int(float64(criticalTime)/float64(elapsedTime)*100)) + } } cp.log.Verbose("critical path:") for i := len(criticalPath) - 1; i >= 0; i-- {