timers.hpp 1.2 KB

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