[C++11]std::chrono时间处理类
2016-08-01 18:04
169 查看
时间类分为:时间,时间点,时间间隔
时间点相减就是时间间隔。不用考虑细节。时间点相减之后需要 用duration_cast转化为某一单位ns,ms等。
时间间隔的单位可以自己定义如下: 也可以用标准的ms,ns等
duration模板类
template<
class Rep,
class Period = std::ratio<1>
> class duration;
Period决定了表示时间的尺度,默认为1
参考
http://www.cnblogs.com/jwk000/p/3560086.html
时间点相减就是时间间隔。不用考虑细节。时间点相减之后需要 用duration_cast转化为某一单位ns,ms等。
时间间隔的单位可以自己定义如下: 也可以用标准的ms,ns等
typedef duration < /* see rep below */, milli > milliseconds;
duration模板类
template<
class Rep,
class Period = std::ratio<1>
> class duration;
Period决定了表示时间的尺度,默认为1
参考
http://www.cnblogs.com/jwk000/p/3560086.html
相关文章推荐
- C++11新特性,利用std::chrono精简传统获取系统时间的方法
- C++11新特性,利用std::chrono精简传统获取系统时间的方法
- C++11新特性,std::chrono获取系统时间
- C++11新特性,利用auto和std::chrono获取系统时间的方法
- c++11 chrono时间处理函数
- C++11新特性,利用std::chrono精简传统获取系统时间的方法
- c++11 处理时间和日期
- c++11知识点3_chrono时间模板库
- c++11 std::chrono
- C++11 新的计时方法——std::chrono 大法好
- C++11 新的计时方法——std::chrono 大法好
- C++11中的便利工具--chrono库(处理日期和时间)
- c++11 Chrono时间库
- C++11中的便利工具--chrono库(处理日期和时间)
- c++11时间相关库(chrono)
- C++11 新的计时方法——std::chrono 大法好
- 处理时间的类
- SQLSERVER处理时间小结
- ORACLE9i处理毫秒级时间
- struts时间格式转换问题处理方案