C++时间获取方法

1.GetTickCount()获取从开机到现在经历的毫秒数

2.

time_t tTime;// time_t是long型
time(&tTime);

一般可以这样用:time_t t = time(NULL) ;

3.

SYSTEMTIME time;

GetLocalTime(&time);

printf("当前时间为:%2d:%2d:%2d\n",time.wHour,time.wMinute,time.wSecond);


你可能感兴趣的:(C++,null)