def timeit_block(unit='s', label=""):
    """
    测试代码块耗时

    :param unit: 时间单位，有 's','m','h' 可选（seconds，minutes，hours）
    :param label: 代码块标签
    """
    start = time.time()
    try:
        yield
    finally:
        _format(unit, time.time() - start, label)
def timeit_block(unit='s', label=""):
    """
    测试代码块耗时

    :param unit: 时间单位，有 's','m','h' 可选（seconds，minutes，hours）
    :param label: 代码块标签
    """
    start = time.time()
    try:
        yield
    finally:
        _format(unit, time.time() - start, label)
def timeit_block ( unit = 's' , label = "" ) : start = time . time ( ) try : yield finally : _format ( unit , time . time ( ) - start , label )
测试代码块耗时

    :param unit: 时间单位，有 's','m','h' 可选（seconds，minutes，hours）
    :param label: 代码块标签
测试代码块耗时