POCO时间戳和时间班
Poco TimeStamps and Timespans
我正在尝试使用POCO时间类来计算程序中的某些时间。我想在线程中检测到时间。
我正在创建第一个时间板,以表示我的时间段,时间扫,用于启动线程时的时间戳,以及检查当前时间板是否大于超时时间(即。
)。Poco::Timestamp startTime;
Poco::Timespan timeOutTime(60*Poco::Timespan::SECONDS); // 60s timeout
我想在计时器函数中检查超时:
bool Process::isTimedOut()
{
Timestamp now;
if((now - startTime) > timeOutTime)
{
return true;
}
else
{
return false;
}
}
但是,如果语句不编译,则在上面的超时检查:说非法结构操作。
有关如何使用这些POCO类的线索?
这与Poco::Timespan
:
bool isTimedOut()
{
Poco::Timestamp now;
Poco::Timespan timeElapsed(now - startTime);
if( timeElapsed > timeOutTime)
{
return true;
}
else
{
return false;
}
}
相关文章:
- C++:floor unix时间戳到UTC月份
- 如何在c++中录制具有精确帧时间戳的视频
- 在两台机器之间进行时间戳的最佳c++chrono函数是什么
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 在多个时间戳处执行函数
- 以天C++为单位的两个时间戳之间的差异
- 获取 QInputEvent 在 Qt 4.8 中被放入 QEventLoop 队列时的时间戳
- 在 C++ 中为文件名添加时间戳
- 如何从远程 SFTP 服务器获取 HH-MM-SS 时间戳格式的文件列表
- 如何将消息时间戳写入日志文件?
- 将时间戳打印到流的最简单方法
- 读取悖论时间戳字段
- C++程序中多个位置的时间 (0) 时间戳
- 在 c++ 中获取 X 毫秒前的时间戳
- 将 unix 时间戳转换为人类可读的日期
- Microsoft NTLM (v2) 中的时间戳使用
- C++中上周一的时间戳
- 升压C 的时期时间/时间格式
- 如何在C 11中找到持续时间(时间)单位
- 如何解析带有日期-时间+时间偏移的字符串到boost::posix_time::ptime