您的位置:首页 > 其它

How to get the current time in milliseconds in C Programming?

2014-03-24 09:39 453 查看
http://stackoverflow.com/questions/8558625/how-to-get-the-current-time-in-milliseconds-in-c-programming

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

int main()
{
clock_t t1, t2;

t1 = clock();

int i;

for(i = 0;i < 1000000 ;i++)
{
int x = 90;
}

t2 = clock();

float diff = (((float)t2 - (float)t1) / 1000000.0F ) * 1000;
printf("%f",diff);

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: