# 在 MicroPython 中使用直接导入
import timer.timer
Timer = timer.timer.Timer

"""
def main():
    # 方式1：使用start/stop方法
    timer = Timer()
    timer.start()
    example_function()
    timer.stop()
    costTime = timer.elapsed_ms()
    print(f"方式1 - 函数运行时间: {costTime:.3f} 秒")
    
    # 方式2：使用with语句（更优雅的方式）
    with Timer() as timer:
        example_function()
    
    costTime = timer.elapsed()
    print(f"方式2 - 函数运行时间: {costTime:.3f} 秒")

if __name__ == '__main__':    
    main()

"""