def startTest(self, doc, output): timer = coreutils.Timer() checkModel(doc, output) endtime = timer.get_time() endtime_hms = str(datetime.timedelta(seconds=endtime)) endtime_hms_claim = "Transaction took " + endtime_hms print(endtime_hms_claim)
engine = IronPython.Hosting.Python.CreateEngine(options) engine.SetSearchPaths(framework.List[str]([MISC_LIB_DIR, MAIN_LIB_DIR])) runtime = engine.Runtime return engine, runtime def shutdown(runtime): runtime.Shutdown() engine_times = [] output_times = [] for idx in range(1, MAX_TESTS): engine, runtime = make_engine() engine_timer = coreutils.Timer() run(engine, runtime) eng_time = engine_timer.get_time() shutdown(runtime) engine_times.append(eng_time) output_timer = coreutils.Timer() print('Engine {}: {}'.format(idx, eng_time)) output_times.append(output_timer.get_time()) chart = output.make_line_chart() # chart.options.scales = {'xAxes': [{'ticks': {'fixedStepSize': 5}, 'type': 'category', 'position': 'bottom'}], # 'yAxes': [{'ticks': {'fixedStepSize': 10}}]} chart.data.labels = [x for x in range(0, MAX_TESTS + 1)]
#from pyrevit.coreutils import os, re, shutil, codecs import os, re, shutil, codecs from pyrevit import revit, DB from pyrevit.revit import query, sys from pyrevit import script from pyrevit import forms import csv from pyrevit import versionmgr # SET DEBUGG TO TRUE FOR VERBOSE LOGGING IN CONSOLE WINDOW debugg = False # SET DEBUGG_OUTPUT TO FALSE TO STOP OUTPUT FOR TESTING debugg_output = True #2019/03/08: modified to use coreutils timer module timer = coreutils.Timer() #logger = script.get_logger() # ... #----------BASIC VARIABLE DEFINITIONS-------- # Note: at some point it would be good to add variable TYPE to variable names... sht_placeholder = "ZZ" rev_count = 0 sheets_count = 0 rev_count_total = 0 sheets_count_total = 0 worksharing = False FileError = 0 # LINKED MODEL variables