RakTimer.h 746 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #pragma once
  11. #include "RakNetTime.h"
  12. #include "GetTime.h"
  13. using namespace RakNet;
  14. class RakTimer
  15. {
  16. public:
  17. RakTimer(void);
  18. RakTimer(int lengthInMilliseconds);
  19. ~RakTimer(void);
  20. void SetTimerLength(int lengthInMilliseconds);
  21. void Start();
  22. void Pause();
  23. void Resume();
  24. bool IsExpired();
  25. private:
  26. int timerLength;//Modified by SetTimerLength
  27. int pauseOffset;
  28. TimeMS startTime;
  29. };
粤ICP备19079148号