From 3a9d6a6a6cca1151ec8aa206ce4abfa63ab97433 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 23 Aug 2015 23:00:22 -0700 Subject: [PATCH] Added running time elapsed to make.py --- tools/make.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tools/make.py b/tools/make.py index 8eb8950c7f..0420b2df92 100644 --- a/tools/make.py +++ b/tools/make.py @@ -30,7 +30,7 @@ ############################################################################### -__version__ = "0.4" +__version__ = "0.6" import sys @@ -49,6 +49,7 @@ import configparser import json import traceback import time +import timeit import re from tempfile import mkstemp @@ -116,6 +117,20 @@ def get_directory_hash(directory): #print_yellow("Hash Value for {} is {}".format(directory,retVal)) return directory_hash.hexdigest() +def Fract_Sec(s): + temp = float() + temp = float(s) / (60*60*24) + d = int(temp) + temp = (temp - d) * 24 + h = int(temp) + temp = (temp - h) * 60 + m = int(temp) + temp = (temp - m) * 60 + sec = temp + return d,h,m,sec + #endef Fract_Sec + + # Copyright (c) André Burgaud # http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ if sys.platform == "win32": @@ -863,7 +878,7 @@ See the make.cfg file for additional build options. check_external = True else: check_external = False - + if "version" in argv: argv.remove("version") version_update = True @@ -897,7 +912,7 @@ See the make.cfg file for additional build options. # Project prefix (folder path) prefix = cfg.get(make_target, "prefix", fallback="") - + # Release archive prefix zipPrefix = cfg.get(make_target, "zipPrefix", fallback=project.lstrip("@").lower()) @@ -1418,5 +1433,8 @@ See the make.cfg file for additional build options. if __name__ == "__main__": + start_time = timeit.default_timer() main(sys.argv) + d,h,m,s = Fract_Sec(timeit.default_timer() - start_time) + print("\nTotal Program time elapsed: {0:2}h {1:2}m {2:4.5f}s".format(h,m,s)) input("Press Enter to continue...")