timers.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2010 Vicente J. Botet Escriba
  3. * Copyright 2015 Andrey Semashev
  4. *
  5. * Distributed under the Boost Software License, Version 1.0.
  6. * See http://www.boost.org/LICENSE_1_0.txt
  7. */
  8. #ifndef BOOST_WINAPI_TIMERS_HPP_INCLUDED_
  9. #define BOOST_WINAPI_TIMERS_HPP_INCLUDED_
  10. #include <boost/winapi/basic_types.hpp>
  11. #ifdef BOOST_HAS_PRAGMA_ONCE
  12. #pragma once
  13. #endif
  14. #if !defined( BOOST_USE_WINDOWS_H )
  15. extern "C" {
  16. BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  17. QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount);
  18. BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  19. QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency);
  20. } // extern "C"
  21. #endif
  22. namespace boost {
  23. namespace winapi {
  24. BOOST_FORCEINLINE BOOL_ QueryPerformanceCounter(LARGE_INTEGER_* lpPerformanceCount)
  25. {
  26. return ::QueryPerformanceCounter(reinterpret_cast< ::_LARGE_INTEGER* >(lpPerformanceCount));
  27. }
  28. BOOST_FORCEINLINE BOOL_ QueryPerformanceFrequency(LARGE_INTEGER_* lpFrequency)
  29. {
  30. return ::QueryPerformanceFrequency(reinterpret_cast< ::_LARGE_INTEGER* >(lpFrequency));
  31. }
  32. }
  33. }
  34. #endif // BOOST_WINAPI_TIMERS_HPP_INCLUDED_