gpt4 book ai didi

c++ - 我需要帮助来理解 CLOCKS_PER_SEC

转载 作者:行者123 更新时间:2023-11-28 05:32:07 26 4
gpt4 key购买 nike

我使用 AMD FX 43003.8GHz,这意味着每秒 3.8G 时钟。但是当我运行命令 CLOCKS_PER_SEC 时,它显示了其他内容。

#include <time.h>    
#include <stdio.h>

int main()
{
printf("%lu\n",CLOCKS_PER_SEC);

return 0;
}

它显示:1000

是吗?

我的处理器或这个程序的工作有什么问题吗?

最佳答案

撇开其他问题不谈,CLOCKS_PER_SEC 并不可靠。

例如(see the linux clock man page):

POSIX requires that CLOCKS_PER_SEC equals 1000000 independent of the actual resolution.

关于c++ - 我需要帮助来理解 CLOCKS_PER_SEC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39242159/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com