timers.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include <boost/winapi/detail/header.hpp>
  12. #ifdef BOOST_HAS_PRAGMA_ONCE
  13. #pragma once
  14. #endif
  15. #if !defined( BOOST_USE_WINDOWS_H )
  16. extern "C" {
  17. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  18. QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount);
  19. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  20. QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency);
  21. } // extern "C"
  22. #endif
  23. namespace boost {
  24. namespace winapi {
  25. BOOST_FORCEINLINE BOOL_ QueryPerformanceCounter(LARGE_INTEGER_* lpPerformanceCount)
  26. {
  27. return ::QueryPerformanceCounter(reinterpret_cast< ::_LARGE_INTEGER* >(lpPerformanceCount));
  28. }
  29. BOOST_FORCEINLINE BOOL_ QueryPerformanceFrequency(LARGE_INTEGER_* lpFrequency)
  30. {
  31. return ::QueryPerformanceFrequency(reinterpret_cast< ::_LARGE_INTEGER* >(lpFrequency));
  32. }
  33. }
  34. }
  35. #include <boost/winapi/detail/footer.hpp>
  36. #endif // BOOST_WINAPI_TIMERS_HPP_INCLUDED_