导视:
|
类
|
特点
|
缺点
|
说明 |
|
timer
|
计时基类
|
不适合大跨度时间
|
适用大部分的普通计时 |
|
progress_timer
|
继承自timer 可以自动写入流中
|
只精确到0.01s
|
如果需要更精确,可派生个类,调用stream的precision设置 |
| progress_display | 图形化显示进度 | 只能输出到cout |
如果还有其他输出则会干扰进度显示。 折中的办法是重新显示 pd.restart(size); pd+= pNum; |
| date | 日期结构,时间点 | —— | date是date_time库的核心类 boost::gregorian |
| date_duration | days、months、years 时间段 | —— | 表示一段时间,可以把它看成一个int |
| date_period | 标量,左开右闭,时间区间 | —— | 可以认为是一个有起点的date_duration。能做交集、并集 |
| date_iterator | 迭代器,以某个单位增减 | —— | 天、周、月、年四种迭代器,以某种增量移动。 |
| time_duration | 时间段 同date_duration | —— | hours、minutes、seconds、millisec、boost::posix_time |
| ptime | 时间点 date+time_duration | —— | 分date()和time_of_day()操作。 |
| time_period | 时间区间 同date_period | —— | —— |
| time_iterator | 迭代器,以某个单位增减 | —— | 可直接与ptime比较 |
| date_facet | 流格式化日期 | —— | %Y年%m月%d日 |
| time_facet | 流格式化时间 | —— | %Y年%m月%d日 %H点%M分%S%F秒 |
