本文整理汇总了Python中Timer.Timer.elapsed_str方法的典型用法代码示例。如果您正苦于以下问题:Python Timer.elapsed_str方法的具体用法?Python Timer.elapsed_str怎么用?Python Timer.elapsed_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer.Timer
的用法示例。
在下文中一共展示了Timer.elapsed_str方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import elapsed_str [as 别名]
def run(self, options):
config = Config()
config.keep_results = options['keep_results']
config.create_diffs = options['create_diffs']
config.update_refs = options['update_refs']
t = Timer()
docs = options['tests']
docs_dir = options['docs_dir']
if len(docs) == 1:
if os.path.isdir(docs[0]):
if docs_dir is None:
docs_dir = docs[0]
if docs_dir == docs[0]:
docs = []
else:
if docs_dir is None:
docs_dir = os.path.dirname(docs[0])
else:
if docs_dir is None:
docs_dir = os.path.commonprefix(docs).rpartition(os.path.sep)[0]
tests = TestRun(docs_dir, options['refs_dir'], options['out_dir'])
status = tests.run_tests(docs)
tests.summary()
get_printer().printout_ln("Tests run in %s" % (t.elapsed_str()))
return status
示例2: run
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import elapsed_str [as 别名]
def run(self, options):
config = Config()
config.src_dir = options["src_dir"]
config.builder = options["builder"]
config.prefix = options["prefix"]
config.good = options["good"]
config.bad = options["bad"]
doc = options["test"]
if not os.path.isfile(doc):
get_printer().printerr("Invalid test %s: not a regulat file" % (doc))
return
t = Timer()
bisect = Bisect(options["test"], options["refs_dir"], options["out_dir"])
bisect.run()
get_printer().printout_ln("Tests run in %s" % (t.elapsed_str()))
示例3: run
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import elapsed_str [as 别名]
def run(self, options):
config = Config()
config.src_dir = options['src_dir']
config.builder = options['builder']
config.prefix = options['prefix']
config.good = options['good']
config.bad = options['bad']
doc = options['test']
if not os.path.isfile(doc):
print("Invalid test %s: not a regulat file" % (doc))
return
t = Timer()
bisect = Bisect(options['test'], options['refs_dir'], options['out_dir'])
bisect.run()
print("Tests run in %s" % (t.elapsed_str()))
示例4: run
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import elapsed_str [as 别名]
def run(self, options):
config = Config()
config.force = options['force']
config.checksums_only = options['checksums_only']
t = Timer()
doc = options['tests']
if os.path.isdir(doc):
docs_dir = doc
else:
docs_dir = os.path.dirname(doc)
refs = TestReferences(docs_dir, options['refs_dir'])
if doc == docs_dir:
refs.create_refs()
else:
refs.create_refs_for_file(os.path.basename(doc))
print("Refs created in %s" % (t.elapsed_str()))
示例5: run
# 需要导入模块: from Timer import Timer [as 别名]
# 或者: from Timer.Timer import elapsed_str [as 别名]
def run(self, options):
config = Config()
config.keep_results = options['keep_results']
config.create_diffs = options['create_diffs']
t = Timer()
doc = options['tests']
if os.path.isdir(doc):
docs_dir = doc
else:
docs_dir = os.path.dirname(doc)
tests = TestRun(docs_dir, options['refs_dir'], options['out_dir'])
if doc == docs_dir:
tests.run_tests()
else:
tests.run_test(os.path.basename(doc))
tests.summary()
print("Tests run in %s" % (t.elapsed_str()))