C语言计时

1.time(NULL)  计时最小单位为s

2.time.h

int main() {
    clock_t start, end;
    start = clock();

    end = clock();
    printf("%f",(float)(end-start)/CLK_TCK);
}

3.windows.h  显示ms数

DWORDstart,end;
start= GetTickCount();
//…calculating…
end= GetTickCount();
printf("time=%d
",end-start);
原文地址:https://www.cnblogs.com/Json28/p/11032006.html