/* */ #ifndef _D_SPEED_CALC_H_ #define _D_SPEED_CALC_H_ #include "common.h" #include "TimeA2.h" class SpeedCalc { private: long long int lengthArray[2]; int sw; Time cpArray[2]; int maxSpeed; int prevSpeed; bool isIntervalOver() const; void changeSw(); public: SpeedCalc() { reset(); } ~SpeedCalc() {} /** * Returns download/upload speed in byte per sec */ int calculateSpeed(); int getMaxSpeed() const { return maxSpeed; } void update(int bytes); void reset(); }; #endif // _D_SPEED_CALC_H_