diff --git a/internal/builder/builder.go b/internal/builder/builder.go index 40fa9f4..58a49e6 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -30,7 +30,7 @@ type Builder struct { func (builder Builder) Execute(project common.Project, cfg config.Config) error { builder.StartTimer() - defer builder.PrintElapsed("\nBuild time:") + defer builder.PrintElapsed("Build time:") if builder.GOOS == "" { builder.GOOS = runtime.GOOS diff --git a/internal/common/timer.go b/internal/common/timer.go index c4af434..51dbe2c 100644 --- a/internal/common/timer.go +++ b/internal/common/timer.go @@ -18,5 +18,5 @@ func (t *Timer) StartTimer() { // PrintElapsed prints the elapsed time to stdout func (t *Timer) PrintElapsed(prefix string) { - log.Info(prefix, time.Since(t.start)) + log.Info("\n", prefix, time.Since(t.start)) } diff --git a/internal/packager/packager.go b/internal/packager/packager.go index b9906f2..b366abd 100644 --- a/internal/packager/packager.go +++ b/internal/packager/packager.go @@ -18,6 +18,7 @@ type Packager struct { common.Compressor common.FileSystem common.Logging + common.Timer Concurrency int Verbose bool @@ -26,6 +27,9 @@ type Packager struct { // Execute executes the command func (packager Packager) Execute(project common.Project, cfg config.Config) error { + packager.StartTimer() + defer packager.PrintElapsed("Package time:") + if packager.Concurrency < 1 { packager.Concurrency = runtime.NumCPU() }