大家好,又见面了,我是你们的朋友全栈君。
#include <time.h>
#include <stdio.h>
void wait ( int m_seconds )
{
clock_t endwait;
endwait = clock () + m_seconds ;
while (clock() < endwait) {}
}
// VC下clock_t应为double
int main(void)
{
clock_t start, end;
start = clock();
wait(3000);
end = clock();
printf(“The time was: %f/n”, (end – start) / CLK_TCK);
return 0;
}
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/137057.html原文链接:https://javaforall.cn