diff options
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index c58466c2..2aec5e08 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -19,6 +19,7 @@ import os import shutil import logging import tempfile +import datetime import morphlib import distbuild @@ -306,6 +307,7 @@ class BuildCommand(object): in either the local or remote cache already. ''' + starttime = datetime.datetime.now() self.app.status(msg='Building %(kind)s %(name)s', name=source.name, kind=source.morphology['kind']) @@ -353,6 +355,12 @@ class BuildCommand(object): self.build_and_cache(staging_area, source, setup_mounts) self.remove_staging_area(staging_area) + td = datetime.datetime.now() - starttime + hours, remainder = divmod(int(td.total_seconds()), 60*60) + minutes, seconds = divmod(remainder, 60) + td_string = "%02d:%02d:%02d" % (hours, minutes, seconds) + self.app.status(msg="Elapsed time %(duration)s", duration=td_string) + def get_recursive_deps(self, artifacts): deps = set() ordered_deps = [] |