本文整理汇总了Python中timer.Timer.get_time_hhmmss方法的典型用法代码示例。如果您正苦于以下问题:Python Timer.get_time_hhmmss方法的具体用法?Python Timer.get_time_hhmmss怎么用?Python Timer.get_time_hhmmss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类timer.Timer
的用法示例。
在下文中一共展示了Timer.get_time_hhmmss方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: benchmark
# 需要导入模块: from timer import Timer [as 别名]
# 或者: from timer.Timer import get_time_hhmmss [as 别名]
def benchmark(benchmarkConfig):
timer = Timer()
print("======================================= {} ==========================================".format(benchmarkConfig))
timePostById = getPostById()
if (benchmarkConfig == 'Config2') | (benchmarkConfig == 'Config5'):
timePostByUrl = getPostByUrl()
else:
timePostByUrl = 0
timeCollection1 = collectionQuery1()
timeCollection2 = collectionQuery2()
timeCollection3 = collectionQuery3()
print("=================================== {} COMPLETED ====================================".format(benchmarkConfig))
print("Total Time : {}".format(timer.get_time_hhmmss()))
json_data = {}
try:
with open('benchmark.json') as json_file:
json_data = json.load(json_file)
except Exception as err:
print(err)
result = json_data
result.update({benchmarkConfig:{'postById': timePostById, 'postByUrl': timePostByUrl, 'collection1': timeCollection1, 'collection2': timeCollection2, 'collection3': timeCollection3}})
with open ('benchmark.json', 'w') as outfile:
json.dump(result, outfile, indent = 4)
示例2: process
# 需要导入模块: from timer import Timer [as 别名]
# 或者: from timer.Timer import get_time_hhmmss [as 别名]
def process():
fake = Faker()
timer = Timer()
print("=====================================================")
print("Timer started at : " + timer.get_time_hhmmss())
print("=====================================================")
createDatabase()
createTables()
tagsPopulator()
displayTimer(timer.get_time_hhmmss(), 'Elapsed')
for totalSites in range(siteConfig['siteCount']):
site = fake.pystr(max_chars = 20)
postsPopulator(site)
displayTimer(timer.get_time_hhmmss(), 'Elapsed')
tagsRelationGenerator()
displayTimer(timer.get_time_hhmmss(), 'Elapsed')
print("=====================================================")
print("Mock Database Created")
print("=====================================================")
executionTime = timer.get_time_hhmmss()
displayTimer(timer.get_time_hhmmss(), 'Execution')