用于在实时系统中测量和验证响应时间的宏。
宏 | 定义 |
---|---|
CppTest_Time CppTest_TimeInit(CPPTEST_INTEGER seconds, CPPTEST_INTEGER nanoseconds); | 使用给定的值初始化 CppTest_Time 结构体。纳秒数应在 -999999999 到 999999999 之间。 |
CppTest_Time CppTest_TimeCurrent() | 使用当前时间初始化 CppTest_Time 结构体。时间以自 1970 年 1 月 1 日 00:00:00 UTC 起经过的秒数(和纳秒数)存储。精确度取决于所使用的平台。 |
CppTest_Time CppTest_TimeDiff(CppTest_Time t1, CppTest_Time t2) | 返回 t1 和 t2 之间的差。 |
int CppTest_TimeCompare(CppTest_Time t1, CppTest_Time t2) | 比较两个 CppTest_Time 结构体。返回: < 0:如果 t1 小于/早于 t2 == 0:如果 t1 和 t2 相等 > 0:如果 t1 大于/晚于 t2 |