- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py. - Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files. - Updated install_dependencies.py to improve dependency installation prompts. - Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability. - Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries. - Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability. - Updated __init__.py in typings to remove unnecessary lines. - Modified app.js to adjust default configuration values and clean up unused code.
45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
测试time导入修复
|
|
"""
|
|
|
|
import time
|
|
|
|
def test_time_import():
|
|
"""测试time模块导入和使用"""
|
|
|
|
print("测试time模块导入和使用...")
|
|
|
|
# 模拟read_fudai_detail_once函数的开始部分
|
|
try:
|
|
start_time = time.time()
|
|
print(".3f")
|
|
except Exception as e:
|
|
print(f"[ERROR] time.time()调用失败: {e}")
|
|
return False
|
|
|
|
# 模拟函数内部的逻辑
|
|
try:
|
|
task_count = 0
|
|
# 清除标志
|
|
# 模拟等待逻辑(之前有问题的部分)
|
|
wait_start = time.time()
|
|
print(".3f")
|
|
# 模拟循环
|
|
while time.time() - wait_start < 0.1: # 很短的时间
|
|
pass
|
|
|
|
elapsed = time.time() - start_time
|
|
print(".3f")
|
|
except Exception as e:
|
|
print(f"[ERROR] 函数内部time使用失败: {e}")
|
|
return False
|
|
|
|
print("[OK] time模块导入和使用正常")
|
|
return True
|
|
|
|
if __name__ == "__main__":
|
|
success = test_time_import()
|
|
print(f"\n测试结果: {'PASS' if success else 'FAIL'}")
|