30 #ifndef TINS_TIMESTAMP_H 31 #define TINS_TIMESTAMP_H 34 #include <tins/macros.h> 35 #include <tins/cxxstd.h> 50 typedef long seconds_type;
51 typedef long microseconds_type;
53 typedef time_t seconds_type;
54 typedef suseconds_t microseconds_type;
71 template<
typename Rep,
typename Period>
72 Timestamp(
const std::chrono::duration<Rep, Period>& ts) {
73 timestamp_ = std::chrono::duration_cast<std::chrono::microseconds>(ts).count();
87 seconds_type seconds()
const;
95 microseconds_type microseconds()
const;
101 operator std::chrono::microseconds()
const {
102 return std::chrono::microseconds(timestamp_);
113 #endif // TINS_TIMESTAMP_H Timestamp(const std::chrono::duration< Rep, Period > &ts)
Definition: timestamp.h:72
The Tins namespace.
Definition: address_range.h:38
Represents a packet timestamp.
Definition: timestamp.h:47