gpt4 book ai didi

c - 测量耗时

转载 作者:行者123 更新时间:2023-11-30 15:49:54 25 4
gpt4 key购买 nike

我添加了以下代码来测量以了解程序持续了多少毫秒。问题是我得到 1065 个时钟和 1065 毫秒。他们平等正常吗?也许我的将时钟转换为毫秒的方程式是错误的?提前致谢

finishClock = clock();
timeCount = finishClock - startClock ;
printf("Clocks passed: %f\n Milli Seconds passed: %f",timeCount, timeCount*1000/CLOCKS_PER_SEC);

最佳答案

基于 Tcl 引用 here ,它们是同义词:

If the -option argument is -milliseconds, then the command is synonymous with clock milliseconds (see below). This usage is obsolete, and clock milliseconds is to be considered the preferred way of obtaining a count of milliseconds.

关于c - 测量耗时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16021455/

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