mFrame
載入中...
搜尋中...
無符合項目
ElapsedTimer.h
1
7#ifndef MFRAME_A0DC59B9_421F_4443_85B2_74AEBA3DD247
8#define MFRAME_A0DC59B9_421F_4443_85B2_74AEBA3DD247
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "./../lang/Object.h"
16
17//----------------------------------------------------------------------------------------
18
19/* ***************************************************************************************
20 * Namespace
21 */
22namespace ufm::util {
23 class ElapsedTimer;
24} // namespace ufm::util
25
26/* ***************************************************************************************
27 * Class/Interface/Struct/Enum
28 */
30 /* *************************************************************************************
31 * Variable
32 */
33 private:
34 uint64 vStartTime;
35
36 /* *************************************************************************************
37 * Abstract Method
38 */
39
40 /* *************************************************************************************
41 * Construct Method
42 */
43 public:
49
54 virtual ~ElapsedTimer(void) override;
55
56 /* *************************************************************************************
57 * Operator Method
58 */
59
60 /* *************************************************************************************
61 * Override -
62 */
63
64 /* *************************************************************************************
65 * Public Method
66 */
67 public:
73 void start(void);
74
83 uint64 restart(void);
84
90 uint64 elapsed(void) const;
91
99 void advanceStartTime(uint64 microseconds);
100
108 inline bool hasElapsed(uint64 milliseconds) const {
109 return (this->elapsed() >= milliseconds);
110 }
111
112 /* *************************************************************************************
113 * Protected Method
114 */
115
116 /* *************************************************************************************
117 * Private Method
118 */
119
120 /* *************************************************************************************
121 * Static Variable
122 */
123
124 /* *************************************************************************************
125 * Static Method
126 */
127};
128
129/* ***************************************************************************************
130 * End of file
131 */
132
133#endif /* MFRAME_A0DC59B9_421F_4443_85B2_74AEBA3DD247 */
物件基底類別
Definition Object.h:63
Definition ElapsedTimer.h:29
uint64 restart(void)
重設計時器,並回傳重設前的經過時間
void advanceStartTime(uint64 microseconds)
將計時器的起始時間往後推進指定微秒數
uint64 elapsed(void) const
獲取從計時器啟動到現在的經過時間
virtual ~ElapsedTimer(void) override
Destroy the object.
void start(void)
重置計時器
ElapsedTimer(void)
Construct a new object.
bool hasElapsed(uint64 milliseconds) const
判斷計時器是否已經經過指定的毫秒數
Definition ElapsedTimer.h:108
Definition Iterable.h:28