#include <iostream>#include <time.h>#include <windows.h>#include <vector>using namespace std;#pragma warning(disable:4996)/*1.time_t time(0); 2.tm* localtime(time_t*); 3.double difftime(time_t t1, time_t t2); 4.char* ctime(const time_t*); 5.time_t mktime(struct tm* ); 6.clock_t clock(); */
int main()
{
time_t s = time(0);
cout << s << endl;
/*tm *temp = localtime(&s);
int hour = temp->tm_hour;
int minute = temp->tm_min;
int month = temp->tm_mon;
int week = temp->tm_wday;
int year = temp->tm_year + 1900;
int second = temp->tm_sec;
int day = temp->tm_mday;
cout << year << "/" << month << "/" << day << "/" << hour << ":" << minute << ":" << second << " " << "星期" << week << endl;
cout << __DATE__ << " " << __TIME__ << endl;
/*time_t s = time(0);
Sleep(3000);
time_t temp = time(0);
cout << difftime(temp, s) << endl;*/
/*time_t s = time(0);
char *q = ctime(&s);
cout << q << endl;*/
/*clock_t temp = clock();
vector<int> w;
for (int i = 0; i < 1000000; ++i)
{
w.push_back(i);
}
clock_t s = clock();
cout << s - temp << endl;*/
system("pause");
return 0;
}