GetTime.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. /// \file GetTime.h
  11. /// \brief Returns the value from QueryPerformanceCounter. This is the function RakNet uses to represent time. This time won't match the time returned by GetTimeCount(). See http://www.jenkinssoftware.com/forum/index.php?topic=2798.0
  12. ///
  13. #ifndef __GET_TIME_H
  14. #define __GET_TIME_H
  15. #include "Export.h"
  16. #include "RakNetTime.h" // For RakNet::TimeMS
  17. namespace RakNet
  18. {
  19. /// Same as GetTimeMS
  20. /// Holds the time in either a 32 or 64 bit variable, depending on __GET_TIME_64BIT
  21. RakNet::Time RAK_DLL_EXPORT GetTime( void );
  22. /// Return the time as 32 bit
  23. /// \note The maximum delta between returned calls is 1 second - however, RakNet calls this constantly anyway. See NormalizeTime() in the cpp.
  24. RakNet::TimeMS RAK_DLL_EXPORT GetTimeMS( void );
  25. /// Return the time as 64 bit
  26. /// \note The maximum delta between returned calls is 1 second - however, RakNet calls this constantly anyway. See NormalizeTime() in the cpp.
  27. RakNet::TimeUS RAK_DLL_EXPORT GetTimeUS( void );
  28. /// a > b?
  29. extern RAK_DLL_EXPORT bool GreaterThan(RakNet::Time a, RakNet::Time b);
  30. /// a < b?
  31. extern RAK_DLL_EXPORT bool LessThan(RakNet::Time a, RakNet::Time b);
  32. }
  33. #endif
粤ICP备19079148号