算法对比时使用:
#include <time.h> int main( ) { clock_t start, finish; double duration; start=clock(); //....... finish=clock(); duration=(double)(finish-start)/CLOCKS_PER_SEC; printf( "%f\n", duration); }
算法对比时使用:
#include <time.h> int main( ) { clock_t start, finish; double duration; start=clock(); //....... finish=clock(); duration=(double)(finish-start)/CLOCKS_PER_SEC; printf( "%f\n", duration); }