C语言的time函数

#include<time.h>

int fun() {
    clock_t start,finish;
    double time;
    start = clock();
    /*测试时间的代码*/
    finish = clock();
    time = (double)(finish - start)/CLOCKS_PER_SEC;// 精度为一毫秒
    printf("time = %fseconds\n",time);
}

 

posted on 2016-03-22 16:35  校长1991  阅读(156)  评论(0)    收藏  举报