25#ifndef TIMEMORY_COMPONENT_TIMESTAMP_TIMESTAMP_CPP_
26#define TIMEMORY_COMPONENT_TIMESTAMP_TIMESTAMP_CPP_ 1
30#if !defined(TIMEMORY_COMPONENT_TIMESTAMP_HEADER_ONLY_MODE)
32# define TIMEMORY_COMPONENT_TIMESTAMP_INLINE
34# define TIMEMORY_COMPONENT_TIMESTAMP_INLINE inline
52 return "Provides a timestamp for every sample and/or phase";
59 return std::chrono::system_clock::now();
67 std::memset(_repr,
'\0',
sizeof(_repr));
68 std::time_t _value = std::chrono::system_clock::to_time_t(_tp);
70 if(std::strftime(_repr,
sizeof(_repr),
"%a %b %d %T %Y %Z", std::localtime(&_value)))
79 return std::chrono::duration_cast<duration_type>(
record().time_since_epoch()).count();
87 base_type::set_value(
record());
95 base_type::set_value(
record());
102 return base_type::get_value();
109 return as_string(base_type::get_value());
116 return (*
this = _rhs);
133 static auto _v =
record();
150 << val.time_since_epoch().count();
typename component::timestamp::time_point_type timestamp_value_t
tim::mpl::apply< std::string > string
this component stores the timestamp of when a bundle was started and is specialized such that the "ti...
static value_type record()
static std::string label()
static std::string as_string(const time_point_type &_tp)
typename clock_type::time_point time_point_type
static value_type get_reference_ts()
timestamp & operator/=(const timestamp &)
timestamp & operator+=(const timestamp &)
std::string get_display() const
static std::string description()
timestamp_entry_t value_type
std::stringstream stringstream_t
#define TIMEMORY_COMPONENT_TIMESTAMP_INLINE