Files
HW_Lib/sim/Test/sim_test.cpp
JiXieShi 040b9be6b9 feat(sim/oled): 移除未使用的头文件 "graphics.h" 和 "conio.h"
 feat(lib/CMakeLists.txt): 添加 LUI 库支持

 feat(lib/utils/inc/argpase.h): 引入 "stdbool.h" 以支持布尔类型

 feat(sim/display/sim_display.cpp): 重新引入 "graphics.h" 和 "conio.h" 以修复依赖

 feat(sim/lvgl/lv_port_indev.cpp): 移除未使用的头文件 "graphics.h" 和 "easyx.h"

 feat(main.c): 添加 LUI 库支持以增强功能

 feat(lib/lui/lame_ui.c): 新增 LUI 库实现以支持 UI 组件
2024-12-19 22:49:08 +08:00

30 lines
672 B
C++

//
// Created by lydxh on 24-9-21.
//
#include <ctime>
#include <cstdio>
#include "sim_test.h"
void Test_RunTime(char *name, int (*pFunction)(void *)) {
clock_t start, end;
double cpu_time_used;
printf("\n------< %s TEST >------\n", name);
start = clock();
pFunction(NULL);
end = clock();
cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
printf("\n------< %s END >------\n", name);
printf("\nTime taken by %s: %f seconds\n", name, cpu_time_used);
}
SDL_Thread *Test_Run(char *name, int (*pFunction)(void *), void *arg) {
printf("\n------< %s TEST >------\n", name);
return ThreadCreat(pFunction, name, arg);
}