mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
Ref T184 Minor optimization in CTokenBucket: avoid converting interval to seconds
every time a token is consumed, by doing the conversion once in the constructor.
This commit is contained in:
@@ -47,7 +47,7 @@ namespace BlackMisc
|
||||
|
||||
int m_capacity = 10; //!< Maximum capacity of tokens
|
||||
int m_availableTokens = 10; //!< Currently available tokens. The initial value is 10
|
||||
PhysicalQuantities::CTime m_interval; //!< Refill interval, e.g. every 5 secs
|
||||
double m_intervalSecs = 5; //!< Refill interval, e.g. every 5 secs
|
||||
int m_numTokensToRefill; //!< Number of tokens to be refilled each interval
|
||||
QDateTime m_lastReplenishmentTime = QDateTime::currentDateTime(); //!< Last time
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user