我想显示调用函数的时间。那是
void DrawableGameComponent::Update() {
time_t result = time(NULL);
cout << " Updated @ " << asctime(localtime(&result));
}它的工作精细,它给出的日期,月,年的输出随时间。我怎样才能只得到时间。它应该只显示小时:分钟:秒。
另外,调用的时间应该以另一个class.that的另一个成员函数的参数为
void Run();想办法弄到它吗?
发布于 2014-09-23 14:08:12
试着像这样也许:
char myTime[12];
time_t now = time(0);
strftime(myTime, sizeof(myTime), "%H:%M:%S", localtime(&now));
cout << " Updated @ " << myTime;https://stackoverflow.com/questions/25997023
复制相似问题