A class of an attribute that makes an attribute value of the time interval since construction. More...
#include <timer.hpp>
Public Types | |
typedef utc_time_traits::time_type::time_duration_type | value_type |
Attribute value type. More... | |
Public Member Functions | |
timer () | |
Constructor. More... | |
timer (cast_source const &source) | |
Constructor for casting support. More... | |
bool | operator! () const BOOST_NOEXCEPT |
Verifies that the factory is not in empty state. More... | |
attribute_value | get_value () const |
void | swap (attribute &that) BOOST_NOEXCEPT |
The method swaps two factories (i.e. More... | |
Protected Member Functions | |
impl * | get_impl () const BOOST_NOEXCEPT |
void | set_impl (intrusive_ptr< impl > p) BOOST_NOEXCEPT |
Sets the pointer to the factory implementation. More... | |
A class of an attribute that makes an attribute value of the time interval since construction.
The timer attribute calculates the time passed since its construction and returns it on value acquisition. The attribute value type is boost::posix_time::time_duration
.
On Windows platform there are two implementations of the attribute. The default one is more precise but a bit slower. This version uses QueryPerformanceFrequence
/QueryPerformanceCounter
API to calculate elapsed time.
There are known problems with these functions when used with some CPUs, notably AMD Athlon with Cool'n'Quiet technology enabled. See the following links for more information and possible resolutions:
http://support.microsoft.com/?scid=kb;en-us;895980 http://support.microsoft.com/?id=896256
In case if none of these solutions apply, you are free to define BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER
macro to fall back to another implementation based on Boost.DateTime.
Attribute value type.
boost::attributes::timer::timer | ( | ) |
Constructor.
Starts time counting.
|
explicit |
Constructor for casting support.
|
inlineprotectedinherited |
References boost::intrusive_ptr< T >::get().
Referenced by boost::attribute_cast(), boost::attributes::constant< process_id >::get(), boost::attributes::mutable_constant< channel_type >::get_impl(), and boost::attributes::mutable_constant< T, void, void, void >::get_impl().
|
inherited |
|
inlineinherited |
Verifies that the factory is not in empty state.
Verifies that the factory is in empty state
|
inlineprotectedinherited |
Sets the pointer to the factory implementation.
p | Pointer to the implementation. Must not be NULL . |
References boost::multiprecision::backends::p, and boost::intrusive_ptr< T >::swap().
Referenced by boost::attributes::counter< T >::counter().
|
inlineinherited |
The method swaps two factories (i.e.
their implementations).
References boost::intrusive_ptr< T >::swap().
Referenced by boost::sources::aux::severity_level< severity_level >::operator=(), and boost::sources::basic_severity_logger< BaseT, LevelT >::swap_unlocked().