snark
|
#include <clocked_time_stamp.h>
Inherits noncopyable.
Public Member Functions | |
boost::posix_time::ptime | adjusted (const boost::posix_time::ptime &t, std::size_t ticks=1) |
boost::posix_time::ptime | adjusted (const boost::posix_time::ptime &t, boost::posix_time::time_duration period, std::size_t ticks=1) |
clocked_time_stamp (boost::posix_time::time_duration period) | |
constructor, takes event period | |
boost::posix_time::time_duration | period () const |
return current period | |
void | reset () |
reset the approximation | |
~clocked_time_stamp () | |
destructor |
Helps calculate a better approximation for the timestamp that happens with a very frequency (e.g. laser firing).
The first few timestamps may be inaccurate, but eventually (quite fast, if the system is not under heavy load) the adjusted timestamp will converge to the true time of event plus a constant system latency (e.g. time to receive a data packet through a certain bandwidth).
Assumptions:
boost::posix_time::ptime adjusted | ( | const boost::posix_time::ptime & | t, |
std::size_t | ticks = 1 |
||
) |
take event reception timestamp and return adjusted timestamp; ticks are the number of clock cycles between this event and the previous one
boost::posix_time::ptime adjusted | ( | const boost::posix_time::ptime & | t, |
boost::posix_time::time_duration | period, | ||
std::size_t | ticks = 1 |
||
) |
take event reception timestamp and return adjusted timestamp, using new value for the period; ticks are the number of clock cycles between this event and the previous one