35 lines
722 B
C
35 lines
722 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include "t_spi.h"
|
|
#include "t_iic.h"
|
|
#include "t_task.h"
|
|
#include "t_arg.h"
|
|
#include <time.h>
|
|
|
|
void Test(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("\nTime taken by %s: %f seconds\n", name, cpu_time_used);
|
|
|
|
printf("\n------< %s END >------\n", name);
|
|
}
|
|
|
|
int main() {
|
|
srand((unsigned)time(NULL));
|
|
Test("SPI", Test_spi);
|
|
Test("IIC", Test_iic);
|
|
Test("ArgPase", Test_argpase);
|
|
Test("Task", Test_task);
|
|
return 0;
|
|
}
|