很简单,总忘,这里记录一下
#include <time.h>
clock_t start= clock();
...
clock_t end = clock();
float elapse = (float)(end - start ) / CLOCKS_PER_SEC;
请注意:
linux下的CLOCKS_PER_SEC是1000000
Windows下这个数是1000
很简单,总忘,这里记录一下
#include <time.h>
clock_t start= clock();
...
clock_t end = clock();
float elapse = (float)(end - start ) / CLOCKS_PER_SEC;
请注意:
linux下的CLOCKS_PER_SEC是1000000
Windows下这个数是1000