這個範例,計算單位為 microSecond(10-6)
#include <time.h>
clock_t start, end;
double cpu_time_used;
printf("** Start to measure time **\n");
start = clock();
...
...
...
end = clock();
cpu_time_used = ((double) (end - start))*1000000 / (CLOCKS_PER_SEC);
printf("** execution time:%f microseconds\n", cpu_time_used);
printf("** End of measure time **\n");
沒有留言:
發佈留言