This commit is contained in:
JiXieShi
2024-09-21 23:07:22 +08:00
parent 6c9a999c71
commit 8f7f72712c
27 changed files with 100 additions and 81 deletions

View File

@@ -7,7 +7,7 @@
#include <syncstream>
#include "sim_test.h"
void Test_RunTime(char *name, void (*pFunction)(void *)) {
void Test_RunTime(char *name, int (*pFunction)(void *)) {
clock_t start, end;
double cpu_time_used;
@@ -24,11 +24,7 @@ void Test_RunTime(char *name, void (*pFunction)(void *)) {
printf("\nTime taken by %s: %f seconds\n", name, cpu_time_used);
}
void Test_Run(char *name, void (*pFunction)(void *)) {
SDL_Thread *Test_Run(char *name, int (*pFunction)(void *), void *arg) {
printf("\n------< %s TEST >------\n", name);
_beginthread(pFunction, 0, NULL);
return ThreadCreat(pFunction, name, arg);
}

View File

@@ -7,7 +7,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "sim_thread.h"
/**
* @brief 测试函数执行时间
* @param name: [输入] 测试名称
@@ -15,9 +15,9 @@ extern "C" {
* @return void
* @example Test("FunctionName", functionName);
**/
void Test_RunTime(char *name, void (*pFunction)(void *));
void Test_RunTime(char *name, int (*pFunction)(void *));
void Test_Run(char *name, void (*pFunction)(void *));
SDL_Thread *Test_Run(char *name, int (*pFunction)(void *), void *arg);
#ifdef __cplusplus