18 start_time_ = std::chrono::steady_clock::now();
25 using namespace std::chrono;
27 steady_clock::time_point newTime = std::chrono::steady_clock::now();
28 duration<double> time_span =
29 duration_cast<duration<double>>(newTime - start_time_);
31 return time_span.count()*1000.0;
40 double time_sec = this->GetTime()/1000.0;
41 int hours = std::floor(time_sec/60/60);
42 int minutes = std::floor((time_sec-60*60*hours)/60);
43 int seconds = (int)time_sec - 3600*hours - 60*minutes;
46 snprintf(buff,100,
"%02d:%02d:%02d",hours,minutes,seconds);
57 using namespace std::chrono;
58 std::time_t now = system_clock::to_time_t(system_clock::now());
61 size_t end = std::strftime(s, 30,
"%Y-%m-%d %H:%M:%S", std::localtime(&now));
63 if (end < 30) s[end]=
'\0';
70 std::this_thread::sleep_for(time);
static std::string GetLocalDateTimeString()
std::string GetTimeString() const
std::chrono::steady_clock::time_point start_time_
void Sleep(std::chrono::duration< double > time)