SDL2
This commit is contained in:
@@ -134,14 +134,6 @@ float Str2Float(char *str);
|
||||
printf(fmt " ", arr[i]); }\
|
||||
printf("\n"); } while (0)
|
||||
|
||||
/**
|
||||
* @brief 测试函数执行时间
|
||||
* @param name: [输入] 测试名称
|
||||
* @param pFunction: [输入] 指向待测试函数的指针
|
||||
* @return void
|
||||
* @example Test("FunctionName", functionName);
|
||||
**/
|
||||
void Test_RunTime(char *name, void (*pFunction)());
|
||||
|
||||
#define END "\n"
|
||||
#define TYPE_F(v) _Generic((v), \
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include <ctime>
|
||||
#include <stdint.h>
|
||||
#include <cstdlib>
|
||||
#include <syncstream>
|
||||
#include "tool.h"
|
||||
|
||||
float Mapping(float val, float I_Min, float I_Max, float O_Min, float O_Max) {
|
||||
@@ -74,20 +75,3 @@ float Str2Float(char *str) {
|
||||
decimal /= decimalWeight;
|
||||
return float(sign * (integer + decimal));
|
||||
}
|
||||
|
||||
void Test_RunTime(char *name, void (*pFunction)()) {
|
||||
clock_t start, end;
|
||||
double cpu_time_used;
|
||||
|
||||
printf("\n------< %s TEST >------\n", name);
|
||||
|
||||
start = clock();
|
||||
pFunction();
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user