本文整理汇总了Python中pyhocon.config_tree.ConfigTree.get_milliseconds方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigTree.get_milliseconds方法的具体用法?Python ConfigTree.get_milliseconds怎么用?Python ConfigTree.get_milliseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyhocon.config_tree.ConfigTree
的用法示例。
在下文中一共展示了ConfigTree.get_milliseconds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_durations
# 需要导入模块: from pyhocon.config_tree import ConfigTree [as 别名]
# 或者: from pyhocon.config_tree.ConfigTree import get_milliseconds [as 别名]
def test_durations(self):
one_sec = ("1s", "1 s", "1seconds", "1 seconds", " 1s ", " 1 s ",
"1second",
"1000", "1000ms", "1000 ms", "1000 milliseconds", " 1000 milliseconds ",
"1000millisecond",
"1000000us", "1000000 us", "1000000 microseconds", "1000000microsecond",
"1000000000ns", "1000000000 ns", "1000000000 nanoseconds", "1000000000nanosecond",
"0.01666666666666666666666m", "0.01666666666666666666666 minutes", "0.01666666666666666666666 minute",
"0.00027777777777777777777h", "0.00027777777777777777777 hours", "0.00027777777777777777777hour",
"1.1574074074074073e-05d", "1.1574074074074073e-05 days", "1.1574074074074073e-05day")
config_tree = ConfigTree()
nanos_in_one_sec = 1000**3
millis_in_one_sec = 1000
for repr in one_sec:
config_tree.put("one_sec", repr)
assert config_tree.get_nanoseconds() == nanos_in_one_sec
assert config_tree.get_milliseconds() == millis_in_one_sec