gpt4 book ai didi

CLK_TCK 在 Mac 上未声明

转载 作者:太空宇宙 更新时间:2023-11-04 04:30:27 26 4
gpt4 key购买 nike

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

clock_t start, stop;

int main(){
start = clock();
function();
stop = clock();
double duration = (stop - start)/CLK_TCK;
return 0;
}

我在 Xcode 中遇到问题。 CLK_TCK 未声明。如何解决?

最佳答案

在 mac 上使用 CLOCKS_PER_SEC 而不是 CLK_TCK

关于CLK_TCK 在 Mac 上未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36888937/

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