|
libmoost
|
#include <timer.h>
Classes | |
| class | scoped_time |
| used for scoped access to timer More... | |
Public Types | |
| typedef std::vector< std::pair < int, boost::posix_time::ptime > > | threshold_times_type |
Public Member Functions | |
| timer (size_t resolution=4096, int max_threshold_time_ms=(std::numeric_limits< int >::max)(), size_t threshold_resolution=128) | |
| void | time (const boost::posix_time::ptime &start) |
| add a time to the timer | |
| int | min_time () const |
| get the minimum time recorded | |
| float | avg_time () const |
| get the average time recorded | |
| void | avg_stddev_time (float &avg, float &std_dev) const |
| get the average time and standard deviation | |
| int | median_time () const |
| get the median time | |
| int | max_time () const |
| get the maximum time recorded | |
| double | count_per_second () const |
| get the average number of times per second that times were recorded | |
| size_t | count () const |
| get the count | |
| int | get_threshold_time () const |
| template<typename ForwardIterator > | |
| void | all_times (ForwardIterator out) const |
| get all times | |
| threshold_times_type | past_threshold_times (int num) const |
| void | reset () |
| reset timing statistics | |
Private Attributes | |
| boost::mutex | m_mutex |
| std::vector< int > | m_times |
| std::vector< int >::iterator | m_times_p |
| std::vector< int >::iterator | m_times_end |
| int | m_min_time |
| int | m_max_time |
| size_t | m_count |
| boost::posix_time::ptime | m_start_time |
| int | m_max_threshold_time_ms |
| threshold_times_type | m_threshold_times |
| threshold_times_type::iterator | m_threshold_times_p |
| threshold_times_type::iterator | m_threshold_times_end |
timer collects statistics on how many times start()/stop() was called in a second, how many milliseconds elapsed on average between a start()/stop(), and best and worst times
| typedef std::vector< std::pair<int, boost::posix_time::ptime> > moost::timer::threshold_times_type |
| timer::timer | ( | size_t | resolution = 4096, |
| int | max_threshold_time_ms = (std::numeric_limits<int>::max)(), |
||
| size_t | threshold_resolution = 128 |
||
| ) |
| void moost::timer::all_times | ( | ForwardIterator | out | ) | const [inline] |
| void timer::avg_stddev_time | ( | float & | avg, |
| float & | std_dev | ||
| ) | const |
| float timer::avg_time | ( | ) | const |
| size_t timer::count | ( | ) | const |
| double timer::count_per_second | ( | ) | const |
| int moost::timer::get_threshold_time | ( | ) | const [inline] |
| int timer::max_time | ( | ) | const |
| int timer::median_time | ( | ) | const |
| int timer::min_time | ( | ) | const |
| moost::timer::threshold_times_type moost::timer::past_threshold_times | ( | int | num | ) | const |
| void timer::reset | ( | ) |
| void timer::time | ( | const boost::posix_time::ptime & | start | ) |
size_t moost::timer::m_count [private] |
int moost::timer::m_max_threshold_time_ms [private] |
int moost::timer::m_max_time [private] |
int moost::timer::m_min_time [private] |
boost::mutex moost::timer::m_mutex [mutable, private] |
boost::posix_time::ptime moost::timer::m_start_time [private] |
threshold_times_type::iterator moost::timer::m_threshold_times_end [private] |
threshold_times_type::iterator moost::timer::m_threshold_times_p [private] |
std::vector<int> moost::timer::m_times [private] |
std::vector<int>::iterator moost::timer::m_times_end [private] |
std::vector<int>::iterator moost::timer::m_times_p [private] |