clock
ctime
difftime
gmtime
localtime
mktime
strftime
time
场景:
1. 时间运算,显示时间等,
代码:
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <iostream>
using namespace std;
void TestTime()
{
//time_t
//For historical reasons,
//it is generally implemented as an integral value representing
//the number of seconds elapsed since
//00:00 hours, Jan 1, 1970 UTC (i.e., a unix timestamp).
//Although libraries may implement this type using alternative time representations.
time_t t;
time(&t);
//快速输出时间日期,也是静态返回.
char* str_tim