netspeed.h 473 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * netspeed.h
  3. *
  4. * Created on: 2021年12月11日
  5. * Author: Admin
  6. */
  7. #ifndef JNI_CALL_NETSPEED_H_
  8. #define JNI_CALL_NETSPEED_H_
  9. class netspeed {
  10. public:
  11. netspeed();
  12. virtual ~netspeed();
  13. void add(int upload,int download);
  14. void getSpeed(int &up,int &down);
  15. static netspeed* getInstance();
  16. private:
  17. long uploadB;
  18. long downloadB;
  19. long lastTick;
  20. int upSpeed;
  21. int loadSpeed;
  22. };
  23. #define NETSPEED() netspeed::getInstance()
  24. #endif /* JNI_CALL_NETSPEED_H_ */