Files
kunlun/build/build_time_cost_test.py

32 lines
895 B
Python
Raw Normal View History

2024-12-14 15:43:03 +08:00
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
import time
import shutil
2024-12-14 15:43:03 +08:00
if __name__ == "__main__":
time_start=time.time()
if(len(sys.argv)>2):
cmd=f"{' '.join(sys.argv[1:])} > build_log.log"
2025-01-09 14:31:08 +08:00
if not ('not_clean' in sys.argv[1:]):
os.system("python3 ../clear_output.py > /dev/null")
2025-01-17 16:35:20 +08:00
try:
os.remove("../make_flags.txt")
os.remove("../python_script_log.log")
except Exception as e:
print(e)
# os.system("python3 ../praper_vscode.py clear >> ../python_script_log.log")
path="../tools/gen_img/customer"
if os.path.exists(path):
shutil.rmtree(path)
else:
cmd=' '.join(sys.argv[1:])
2024-12-14 15:43:03 +08:00
print(cmd)
os.system(cmd)
time_end=time.time()
print(f"build end, cost {time_end-time_start} s")
print(time.asctime())