int _tmain(int argc, _TCHAR* argv[]) { chrono::time_point<chrono::system_clock> time = std::chrono::system_clock::now(); std::this_thread::sleep_for(chrono::seconds(1)); std::chrono::system_clock::time_point time1 = std::chrono::system_clock::now(); cout << (time1 - time).count() << endl; cout<< std::chrono::duration_cast<std::chrono::seconds >( time1 - time).count()<<endl; __time64_t tt = chrono::system_clock::to_time_t(time); tm* t = localtime(&tt); cout << t->tm_hour << t->tm_min << endl; cout <<put_time(std::localtime(&tt), "%Y-%m-%d %H.%M.%S") << endl; getchar(); return 0; }
chrono
最新推荐文章于 2024-09-22 20:20:04 发布