您的位置:首页 > 其它

时间函数gettimeofday()

2013-11-18 09:56 453 查看
#include <sys/time.h>
struct timeval start,end;
gettimeofday(&start,NULL);
gettimeofday(&end,NULL);

unsigned long duration = 1000*(end.tv_sec-start.tv_sec)+(end.tv_usec-start.tv_usec)/1000;
//sec->second usec->microsecond duration 毫秒格式
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: