56 m_postCounts.
Resize(second + 1);
74 if ( m_nowTickSecond == t )
76 m_postCounts[m_newestIndex] += c;
80 size_t count = m_postCounts.
GetSize();
81 if ( m_validCount < count )
85 if ( m_postCounts[m_newestIndex] > m_maxPostCount )
87 m_maxPostCount = m_postCounts[m_newestIndex];
89 m_newestIndex = (m_newestIndex + 1) % count;
90 m_postCounts[m_newestIndex] = c;
100 if ( m_validCount > 1 )
102 size_t count = m_postCounts.
GetSize();
104 loop ( i, m_validCount - 1 )
106 r += m_postCounts[(count + count + m_newestIndex - i - 1) % count];
109 return a / (m_validCount - 1);
120 return m_maxPostCount;
127 DWORD m_nowTickSecond;
128 DWORD m_maxPostCount;
#define loop(VAR, CNT)
loop構文.
CParSecondCounter(size_t second=5)
コンストラクタ.
void Post(DWORD c=1)
[設定] ポスト.
DWORD GetMax(void) const
[取得] 最大数取得.
void Initialize(size_t second=5)
[設定] 初期化.
double GetAverage(void) const
[取得] 平均取得.
DWORD GetPassedCount(void) const
[取得] 経過時間取得.
void Reset(void)
[設定] リセット.
size_t GetSize(void) const
[取得] サイズ取得
void Resize(size_t l)
[設定] サイズ再設定
#define EXCLUSIVE(CLS)
簡易排他制御マクロ.