求时间差

时间:2014-07-22 23:08:54   收藏:0   阅读:216

time_t   first,   second;

first   =   time(NULL);

//   你的程序         ...............

second   =   time(NULL);

printf("The   difference   is:   %f   seconds\n",difftime(second,first));

 

// 分钟

int imin = (isec / 60) % 60;

// 小时

int ihour = isec / 60 / 60;

//秒

int isec = (isec % 60) % 60;

求时间差,码迷,mamicode.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!