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\n",end-start);

 

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2021-05-31
  • 2021-10-21
  • 2021-12-28
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-12-10
相关资源
相似解决方案