Protocols::BitTorrent::Transfers::IntegerResetStopwatch Class Reference
#include <TransferSessionImpl.h> [code]
List of all members.
Detailed Description
This stopwatch has the special property that
reset() only resets the internal reference point using integer increments. For example, if the
IntegerResetStopwatch object is configured to do a 1 second integer reset, then calling
reset() before a second has elapsed from the internal reference point will not have any effect. If 1,5 seconds have elapsed when reset is called, then
reset() sets the reference point to 0,5 seconds in the past. If 13,3 seconds have elapsed when
reset() is called, then the internal reference point will be set to 0,3 seconds in the past.
This special property is needed by TransferSessionImpl in order to precisely implement the moving average speed over a sliding time window. IntegerResetStopwatch could be handy in other scenarios as well.
- Todo:
- Could derive from a more generic Stopwatch.
Definition at line 51 of file TransferSessionImpl.h.
Constructor & Destructor Documentation
| virtual Protocols::BitTorrent::Transfers::IntegerResetStopwatch::~IntegerResetStopwatch |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
| virtual qint64 Protocols::BitTorrent::Transfers::IntegerResetStopwatch::elapsedSeconds |
( |
|
) |
const [pure virtual] |
|
| virtual void Protocols::BitTorrent::Transfers::IntegerResetStopwatch::reset |
( |
|
) |
[pure virtual] |
|
The documentation for this class was generated from the following file: