表示时间间隔的结构体,支持天、小时、分钟、秒和毫秒粒度。 更多...
#include <sttnet.h>
Public 成员函数 | |
| Duration (long long a, int b, int c, int d, int e) | |
| 构造函数,传入天,时,分,秒,毫秒 更多... | |
| Duration ()=default | |
| bool | operator> (const Duration &b) |
| 判断当前时间间隔是否大于另一个时间间隔。 更多... | |
| bool | operator< (const Duration &b) |
| 判断当前时间间隔是否小于另一个时间间隔。 更多... | |
| bool | operator== (const Duration &b) |
| 判断当前时间间隔是否等于另一个时间间隔。 更多... | |
| bool | operator>= (const Duration &b) |
| 判断当前时间间隔是否大于等于另一个时间间隔。 更多... | |
| bool | operator<= (const Duration &b) |
| 判断当前时间间隔是否小于等于另一个时间间隔。 更多... | |
| Duration | operator+ (const Duration &b) |
| 将两个时间间隔相加。 更多... | |
| Duration | operator- (const Duration &b) |
| 计算两个时间间隔的差值(当前对象减去参数 b)。 更多... | |
| double | convertToDay () |
| 将当前时间间隔转换为以“天”为单位的浮点数表示。 更多... | |
| double | convertToHour () |
| 将当前时间间隔转换为以“小时”为单位的浮点数表示。 更多... | |
| double | convertToMin () |
| 将当前时间间隔转换为以“分钟”为单位的浮点数表示。 更多... | |
| double | convertToSec () |
| 将当前时间间隔转换为以“秒”为单位的浮点数表示。 更多... | |
| long long | convertToMsec () |
| 将当前时间间隔转换为总毫秒数。 更多... | |
| Duration | recoverForm (const long long &t) |
| 从给定的毫秒数恢复为标准的天-时-分-秒-毫秒格式。 更多... | |
Public 属性 | |
| long long | day |
| 天 更多... | |
| int | hour |
| 时 更多... | |
| int | min |
| 分 更多... | |
| int | sec |
| 秒 更多... | |
| int | msec |
| 毫秒 更多... | |
表示时间间隔的结构体,支持天、小时、分钟、秒和毫秒粒度。
|
inline |
构造函数,传入天,时,分,秒,毫秒
|
default |
|
inline |
将当前时间间隔转换为以“天”为单位的浮点数表示。
|
inline |
将当前时间间隔转换为以“小时”为单位的浮点数表示。
|
inline |
将当前时间间隔转换为以“分钟”为单位的浮点数表示。
|
inline |
将当前时间间隔转换为总毫秒数。
|
inline |
将当前时间间隔转换为以“秒”为单位的浮点数表示。
将两个时间间隔相加。
| b | 要相加的另一个 Duration。 |
计算两个时间间隔的差值(当前对象减去参数 b)。
| b | 要减去的另一个 Duration。 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
从给定的毫秒数恢复为标准的天-时-分-秒-毫秒格式。
| t | 要恢复的毫秒值。 |
| long long stt::time::Duration::day |
天
| int stt::time::Duration::hour |
时
| int stt::time::Duration::min |
分
| int stt::time::Duration::msec |
毫秒
| int stt::time::Duration::sec |
秒
1.8.5