摘要: 最近在跑一些程序,需要计算程序运行的时间,然后搜索了一下相关的材料,发现下面的一个比较好的方法,可以实现毫秒级的计时: #include<sys/timeb.h>#ifdefined(WIN32)#defineTIMEB_timeb#defineftime_ftime#else#defineTIMEBtimeb#endiftime_tltime1,ltime2,tmp_time;structTIMEBtstruct1,tstruct2;ftime(&tstruct1);//starttimemstime(&ltime1);//starttimes//worktime 阅读全文
posted @ 2011-11-14 14:47 Mr.Rico 阅读(22248) 评论(0) 推荐(1)