您的位置:首页 > 其它

测试程序运行的时间

2009-07-20 16:38 302 查看
#include <stdio.h>
#include <time.h>
void PrintLocaltime(void)
{
struct tm* timeptr;
time_t secsnow;

time(&secsnow);
timeptr = localtime(&secsnow);
printf("The date is %d-%d-%d/n",
(timeptr->tm_mon) + 1,
(timeptr->tm_mday),
(timeptr->tm_year) + 1900);
printf("Local time is %02d:%02d:%02d/n",
timeptr->tm_hour,
timeptr->tm_min,
timeptr->tm_sec);
}
 

来源《深度探索C++模型》
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  测试 include struct date c