2#ifndef CLICK_TIMESTAMP_HH
3#define CLICK_TIMESTAMP_HH
4#include <click/glue.hh>
7#if !CLICK_LINUXMODULE && !CLICK_BSDMODULE
27#if !TIMESTAMP_REP_FLAT64 && !TIMESTAMP_REP_BIG_ENDIAN && !TIMESTAMP_REP_LITTLE_ENDIAN
29# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
30# define TIMESTAMP_REP_BIG_ENDIAN 1
31# elif BITS_PER_LONG == 64 || defined(CONFIG_KTIME_SCALAR)
32# define TIMESTAMP_REP_FLAT64 1
33# elif defined(__BIG_ENDIAN)
34# define TIMESTAMP_REP_BIG_ENDIAN 1
36# define TIMESTAMP_REP_LITTLE_ENDIAN 1
38# elif HAVE_INT64_TYPES && SIZEOF_LONG == 8
39# define TIMESTAMP_REP_FLAT64 1
40# elif HAVE_INT64_TYPES && CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN
41# define TIMESTAMP_REP_LITTLE_ENDIAN 1
43# define TIMESTAMP_REP_BIG_ENDIAN 1
54#ifndef TIMESTAMP_NANOSEC
56# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
57# define TIMESTAMP_NANOSEC 1
68#if HAVE_INT64_TYPES && !TIMESTAMP_REP_FLAT64
69# if (TIMESTAMP_REP_BIG_ENDIAN && CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN) \
70 || (TIMESTAMP_REP_LITTLE_ENDIAN && CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN)
71# define TIMESTAMP_MATH_FLAT64 1
79#if TIMESTAMP_REP_BIG_ENDIAN
80# if !TIMESTAMP_NANOSEC && SIZEOF_STRUCT_TIMEVAL == 8
81# define TIMESTAMP_PUNS_TIMEVAL 1
82# elif TIMESTAMP_NANOSEC && HAVE_STRUCT_TIMESPEC && SIZEOF_STRUCT_TIMESPEC == 8
83# define TIMESTAMP_PUNS_TIMESPEC 1
94#if !defined(TIMESTAMP_VALUE_INT64) && HAVE_INT64_TYPES
95# if CLICK_LINUXMODULE && defined(do_div)
96# define TIMESTAMP_VALUE_INT64 1
97# elif !CLICK_LINUXMODULE && !CLICK_BSDMODULE
98# define TIMESTAMP_VALUE_INT64 1
108# define PRITIMESTAMP "%d.%09d"
110# define PRITIMESTAMP "%d.%06d"
117#if !CLICK_LINUXMODULE && !CLICK_BSDMODULE && !CLICK_NS && HAVE_SIMTIME
118# define TIMESTAMP_WARPABLE 1
122typedef int64_t (*user_clock_fct)(
void* user,
bool steady);
130#if TIMESTAMP_VALUE_INT64
146 nsec_per_sec = 1000000000,
147 nsec_per_msec = 1000000,
148 nsec_per_usec = 1000,
149 usec_per_sec = 1000000,
150 usec_per_msec = 1000,
163 , schedule_granularity = usec_per_sec
171 typedef uninitialized_type uninitialized_t;
210#if HAVE_STRUCT_TIMESPEC
225 inline operator unspecified_bool_type()
const;
229#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
237 inline uint32_t
subsec()
const;
238 inline uint32_t
msec()
const;
239 inline uint32_t
usec()
const;
240 inline uint32_t
nsec()
const;
249#if TIMESTAMP_PUNS_TIMEVAL
256#if HAVE_STRUCT_TIMESPEC
257# if TIMESTAMP_PUNS_TIMESPEC
265 inline int64_t
longval()
const;
266 inline void assignlong(int64_t);
274#if TIMESTAMP_REP_FLAT64
282#if TIMESTAMP_REP_FLAT64
290#if TIMESTAMP_REP_FLAT64
299 uint32_t x =
subsec() % subsec_per_msec;
300 return (x ? *
this +
Timestamp(0, subsec_per_msec - x) : *
this);
305 uint32_t x =
subsec() % subsec_per_usec;
306 return (x ? *
this +
Timestamp(0, subsec_per_usec - x) : *
this);
322 inline click_jiffies_t
jiffies()
const;
337 Timestamp t = Timestamp::uninitialized_t();
338#if TIMESTAMP_REP_FLAT64
341 value_div_mod(t._t.sec, t._t.subsec,
msec, msec_per_sec);
354 Timestamp t = Timestamp::uninitialized_t();
355#if TIMESTAMP_REP_FLAT64
358 value_div_mod(t._t.sec, t._t.subsec,
usec, usec_per_sec);
371 Timestamp t = Timestamp::uninitialized_t();
372#if TIMESTAMP_REP_FLAT64
375 value_div_mod(t._t.sec, t._t.subsec,
nsec, nsec_per_sec);
397#if TIMESTAMP_REP_FLAT64
425 inline
void set_now() CLICK_DEPRECATED;
427#if !CLICK_LINUXMODULE && !CLICK_BSDMODULE && !CLICK_MINIOS
428 int set_timeval_ioctl(
int fd,
int ioctl_selector);
553#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
556#if TIMESTAMP_REP_BIG_ENDIAN
561#elif TIMESTAMP_REP_LITTLE_ENDIAN
568# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
570# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
574#if TIMESTAMP_PUNS_TIMEVAL
576#elif TIMESTAMP_PUNS_TIMESPEC
581#if TIMESTAMP_WARPABLE
584 enum warp_class_type {
594 static inline int warp_class();
601 static inline double warp_speed();
634 static void warp_set_class(warp_class_type w,
double s = 1.0);
645 inline Timestamp warp_real_delay()
const;
648 static inline bool warp_jumping();
653 static void warp_jump_steady(
const Timestamp &expiry);
666 inline void assign_now_unwarped();
672 static inline Timestamp now_steady_unwarped();
679 inline void assign_now_steady_unwarped();
685 static void set_warp_tick(
unsigned long tick);
689 static bool set_clock(user_clock_fct clock,
void* user);
697 static void* _user_data;
698 static user_clock_fct _user_clock;
701 inline void add_fix() {
702#if TIMESTAMP_REP_FLAT64
704#elif TIMESTAMP_MATH_FLAT64
713 inline void sub_fix() {
714#if TIMESTAMP_REP_FLAT64
716#elif TIMESTAMP_MATH_FLAT64
729 static inline void value_div_mod(int32_t &div, int32_t &rem,
736 inline void assign_now(
bool recent,
bool steady,
bool unwarped,
bool no_user =
false);
738#if TIMESTAMP_WARPABLE
739 static inline void warp_adjust(
bool steady,
const Timestamp &t_raw,
const Timestamp &t_warped);
740 inline Timestamp warped(
bool steady)
const;
741 void warp(
bool steady,
bool from_now);
752class UserClock {
public:
753 enum {h_now, h_now_steady};
754 virtual int64_t now(
bool steady) = 0;
757#if TIMESTAMP_WARPABLE
760 static Timestamp::warp_class_type kind;
763 static double offset[2];
768inline int Timestamp::warp_class() {
769 return TimestampWarp::kind;
772inline double Timestamp::warp_speed() {
773 return TimestampWarp::speed;
776inline bool Timestamp::warp_jumping() {
777 return TimestampWarp::kind >= warp_nowait;
780inline Timestamp Timestamp::warped(
bool steady)
const {
782 if (TimestampWarp::kind)
783 t.warp(steady,
false);
797#if HAVE_STRUCT_TIMESPEC
809Timestamp::operator unspecified_bool_type()
const
811#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
821 (void)
recent, (
void) steady, (void) unwarped, (
void) nouser;
823#if TIMESTAMP_PUNS_TIMESPEC
824# define TIMESTAMP_DECLARE_TSP struct timespec &tsp = _t.tspec
825# define TIMESTAMP_RESOLVE_TSP
827# define TIMESTAMP_DECLARE_TSP struct timespec ts, &tsp = ts
828# define TIMESTAMP_RESOLVE_TSP assign(tsp.tv_sec, nsec_to_subsec(tsp.tv_nsec))
830#if TIMESTAMP_PUNS_TIMEVAL
831# define TIMESTAMP_DECLARE_TVP struct timeval &tvp = _t.tv
832# define TIMESTAMP_RESOLVE_TVP
834# define TIMESTAMP_DECLARE_TVP struct timeval tv, &tvp = tv
835# define TIMESTAMP_RESOLVE_TVP assign(tvp.tv_sec, usec_to_subsec(tvp.tv_usec))
839 if (!nouser && _user_clock != 0) {
840 int64_t current = _user_clock(_user_data,steady);
846# if !TIMESTAMP_NANOSEC
848 TIMESTAMP_DECLARE_TVP;
849 do_gettimeofday(&tvp);
850 TIMESTAMP_RESOLVE_TVP;
854 TIMESTAMP_DECLARE_TSP;
856# if HAVE_LINUX_GET_MONOTONIC_COARSE
857 tsp = get_monotonic_coarse();
858# elif HAVE_LINUX_GETBOOTTIME && HAVE_LINUX_KTIME_MONO_TO_ANY
861 tsp = current_kernel_time();
863 ktime_to_timespec(ktime_mono_to_any(ktime_set(0, 0), TK_OFFS_REAL));
864 set_normalized_timespec(&tsp, tsp.tv_sec - delta.tv_sec,
865 tsp.tv_nsec - delta.tv_nsec);
866# elif HAVE_LINUX_GETBOOTTIME
867 tsp = current_kernel_time();
870 monotonic_to_bootbased(&delta);
871 set_normalized_timespec(&tsp, tsp.tv_sec - delta.tv_sec,
872 tsp.tv_nsec - delta.tv_nsec);
879 tsp = current_kernel_time();
883 getnstimeofday(&tsp);
884 TIMESTAMP_RESOLVE_TSP;
886#elif TIMESTAMP_NANOSEC && CLICK_BSDMODULE
887 TIMESTAMP_DECLARE_TSP;
896 TIMESTAMP_RESOLVE_TSP;
899 TIMESTAMP_DECLARE_TVP;
901 getmicrouptime(&tvp);
908 TIMESTAMP_RESOLVE_TVP;
911 TIMESTAMP_DECLARE_TVP;
912 gettimeofday(&tvp, (
struct timezone *) 0);
913 TIMESTAMP_RESOLVE_TVP;
916 if (schedule_granularity == usec_per_sec) {
917 TIMESTAMP_DECLARE_TVP;
918 simclick_gettimeofday(&tvp);
919 TIMESTAMP_RESOLVE_TVP;
921 assert(0 &&
"nanosecond precision not available yet");
924#elif HAVE_USE_CLOCK_GETTIME
925 TIMESTAMP_DECLARE_TSP;
927 clock_gettime(CLOCK_MONOTONIC, &tsp);
929 clock_gettime(CLOCK_REALTIME, &tsp);
930 TIMESTAMP_RESOLVE_TSP;
933 TIMESTAMP_DECLARE_TVP;
934 gettimeofday(&tvp, (
struct timezone *) 0);
935 TIMESTAMP_RESOLVE_TVP;
938#undef TIMESTAMP_DECLARE_TSP
939#undef TIMESTAMP_RESOLVE_TSP
940#undef TIMESTAMP_DECLARE_TVP
941#undef TIMESTAMP_RESOLVE_TVP
944#ifdef TIMESTAMP_WARPABLE
946 if (!unwarped && TimestampWarp::kind)
960 Timestamp t = Timestamp::uninitialized_t();
974 Timestamp t = Timestamp::uninitialized_t();
988 Timestamp t = Timestamp::uninitialized_t();
1002 Timestamp t = Timestamp::uninitialized_t();
1014#if TIMESTAMP_WARPABLE
1016Timestamp::assign_now_unwarped()
1022Timestamp::now_unwarped()
1024 Timestamp t = Timestamp::uninitialized_t();
1025 t.assign_now_unwarped();
1030Timestamp::assign_now_steady_unwarped()
1036Timestamp::now_steady_unwarped()
1038 Timestamp t = Timestamp::uninitialized_t();
1039 t.assign_now_steady_unwarped();
1050#if TIMESTAMP_REP_FLAT64
1065#if TIMESTAMP_REP_FLAT64
1077#if TIMESTAMP_REP_FLAT64
1078 if (unlikely(_t.x < 0))
1091#if TIMESTAMP_REP_FLAT64
1129#if TIMESTAMP_REP_FLAT64
1143#if TIMESTAMP_REP_FLAT64
1157#if TIMESTAMP_REP_FLAT64
1165inline click_jiffies_t
1168# if TIMESTAMP_REP_FLAT64
1172 click_jiffies_t j = ((click_jiffies_t)
sec()) * CLICK_HZ;
1173# if CLICK_HZ == 100 || CLICK_HZ == 1000 || CLICK_HZ == 10000 || CLICK_HZ == 100000 || CLICK_HZ == 1000000
1186 Timestamp t = Timestamp::uninitialized_t();
1187# if TIMESTAMP_REP_FLAT64
1190 t._t.sec =
jiffies / CLICK_HZ;
1200 Timestamp t = Timestamp::uninitialized_t();
1201# if TIMESTAMP_REP_FLAT64
1205 t._t.sec = -(-(
jiffies + 1) / CLICK_HZ) - 1;
1207 t._t.sec =
jiffies / CLICK_HZ;
1215inline void Timestamp::set_now() {
1219inline void Timestamp::set(seconds_type sec, uint32_t subsec) {
1223inline void Timestamp::set_usec(seconds_type sec, uint32_t usec) {
1227inline void Timestamp::set_nsec(seconds_type sec, uint32_t nsec) {
1240#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
1241 return a._t.x == b._t.x;
1265#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
1266 return a._t.x < b._t.x;
1339#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
1342 a._t.sec += b._t.sec;
1343 a._t.subsec += b._t.subsec;
1355#if TIMESTAMP_REP_FLAT64 || TIMESTAMP_MATH_FLAT64
1358 a._t.sec -= b._t.sec;
1359 a._t.subsec -= b._t.subsec;
1385#if TIMESTAMP_REP_FLAT64
1386 Timestamp t = Timestamp::uninitialized_t();
1402#if TIMESTAMP_REP_FLAT64
1409inline void Timestamp::assignlong(int64_t i) {
1410#if TIMESTAMP_REP_FLAT64
1424# if TIMESTAMP_REP_FLAT64
1435# if TIMESTAMP_REP_FLAT64
1438 double dfloor = floor(d);
1511#if TIMESTAMP_WARPABLE
1513Timestamp::warp_real_delay()
const
1515 if (likely(!TimestampWarp::kind) || TimestampWarp::speed == 1.0)
1518 return *
this / TimestampWarp::speed;
1522#if TIMESTAMP_PUNS_TIMEVAL
1523inline const struct timeval &
1529inline const struct timeval &
1541inline struct timeval
1546 tv.tv_usec = usec();
1555inline struct timeval
1562#if HAVE_STRUCT_TIMESPEC
1563# if TIMESTAMP_PUNS_TIMESPEC
1564inline const struct timespec &
1575inline struct timespec
1580 ts.tv_nsec = nsec();
1595 : is_signed(is_signed) {
1599 return cp_time(str, &value, is_signed);
Argument context class.
Definition args.hh:31
Efficiently build up Strings from pieces.
Definition straccum.hh:28
A string of characters.
Definition string.hh:22
Parser class for timestamps.
Definition timestamp.hh:1593
Represents a moment or interval in time.
Definition timestamp.hh:125
static Timestamp make_jiffies(click_jiffies_t jiffies)
Return a timestamp representing an interval of jiffies.
Definition timestamp.hh:1183
static Timestamp epsilon()
Return the smallest nonzero timestamp, Timestamp(0, 1).
Definition timestamp.hh:383
@ max_seconds
Definition timestamp.hh:137
@ min_seconds
Definition timestamp.hh:140
static uint32_t nsec_to_subsec(uint32_t nsec)
Convert nanoseconds to subseconds.
Definition timestamp.hh:531
static Timestamp make_msec(value_type msec)
Return a timestamp representing msec milliseconds.
Definition timestamp.hh:336
static Timestamp now_steady()
Return the current steady-clock time.
Definition timestamp.hh:986
@ subsec_per_sec
Definition timestamp.hh:153
void assign_recent_steady()
Set this timestamp to a recent steady-clock time.
Definition timestamp.hh:994
uint32_t nsec() const
Return this timestamp's subseconds component, converted to nanoseconds.
Definition timestamp.hh:1117
void assign(seconds_type sec, uint32_t subsec=0)
Definition timestamp.hh:396
static Timestamp now()
Return the current system time.
Definition timestamp.hh:958
int32_t value_type
Return type for msecval(), usecval(), and nsecval().
Definition timestamp.hh:133
int64_t longval() const
Return this timestamp's value in subseconds.
Definition timestamp.hh:1400
Timestamp(const uninitialized_t &unused)
Construct an uninitialized timestamp.
Definition timestamp.hh:220
static uint32_t subsec_to_usec(uint32_t subsec)
Convert subseconds to microseconds.
Definition timestamp.hh:539
bool operator>(const Timestamp &a, const Timestamp &b)
Compare two timestamps.
Definition timestamp.hh:1321
static Timestamp recent_steady()
Return a recent steady-clock time.
Definition timestamp.hh:1000
Timestamp nsec_ceil() const
Return the next nanosecond-valued timestamp no smaller than *this.
Definition timestamp.hh:312
Timestamp()
Construct a zero-valued Timestamp.
Definition timestamp.hh:177
String unparse() const
Unparse this timestamp into a String.
Definition timestamp.cc:240
struct timespec timespec() const
Return a struct timespec with the same value as this timestamp.
Definition timestamp.hh:1576
static Timestamp make_usec(value_type usec)
Return a timestamp representing usec microseconds.
Definition timestamp.hh:353
void set_subsec(uint32_t subsec)
Set this timestamp's subseconds component.
Definition timestamp.hh:1063
seconds_type usec1() const
Return this timestamp's interval length, converted to microseconds.
Definition timestamp.hh:1141
String unparse_interval() const
Unparse this timestamp into a String as an interval.
Definition timestamp.cc:248
bool is_negative() const
Test if this Timestamp is negative (< Timestamp(0, 0)).
Definition timestamp.hh:228
value_type nsecval() const
Return this timestamp's interval length in nanoseconds.
Definition timestamp.hh:289
Timestamp(long sec, uint32_t subsec=0)
Construct a Timestamp of sec seconds plus subsec subseconds.
Definition timestamp.hh:190
double doubleval() const
Return this timestamp's value, converted to a real number.
Definition timestamp.hh:1422
void assign_nsec(seconds_type sec, uint32_t nsec)
Definition timestamp.hh:409
value_type msecval() const
Return this timestamp's interval length in milliseconds.
Definition timestamp.hh:273
Timestamp(int sec, uint32_t subsec=0)
Definition timestamp.hh:194
Timestamp(unsigned long sec, uint32_t subsec=0)
Definition timestamp.hh:198
friend Timestamp & operator+=(Timestamp &a, const Timestamp &b)
Add b to a.
Definition timestamp.hh:1337
uint32_t msec() const
Return this timestamp's subseconds component, converted to milliseconds.
Definition timestamp.hh:1101
seconds_type msec1() const
Return this timestamp's interval length, converted to milliseconds.
Definition timestamp.hh:1127
static Timestamp make_usec(seconds_type sec, uint32_t usec)
Return a timestamp representing sec seconds plus usec microseconds.
Definition timestamp.hh:349
bool operator!=(const Timestamp &a, const Timestamp &b)
Compare two timestamps for inequality.
Definition timestamp.hh:1252
seconds_type nsec1() const
Return this timestamp's interval length, converted to nanoseconds.
Definition timestamp.hh:1155
friend bool operator==(const Timestamp &a, const Timestamp &b)
Compare two timestamps for equality.
Definition timestamp.hh:1238
friend bool operator<(const Timestamp &a, const Timestamp &b)
Compare two timestamps.
Definition timestamp.hh:1263
static uint32_t subsec_to_nsec(uint32_t subsec)
Convert subseconds to nanoseconds.
Definition timestamp.hh:543
static Timestamp make_msec(seconds_type sec, uint32_t msec)
Return a timestamp representing sec seconds plus msec milliseconds.
Definition timestamp.hh:332
int32_t seconds_type
Type represents a number of seconds.
Definition timestamp.hh:128
void assign_now_steady()
Set this timestamp to the current steady-clock time.
Definition timestamp.hh:980
friend Timestamp operator-(const Timestamp &b)
Negate a and return the result.
Definition timestamp.hh:1383
void assign_recent()
Set this timestamp to a recent system time.
Definition timestamp.hh:966
void clear()
Clear this timestamp.
Definition timestamp.hh:388
static Timestamp make_nsec(seconds_type sec, uint32_t nsec)
Return a timestamp representing sec seconds plus nsec nanoseconds.
Definition timestamp.hh:366
uint32_t usec() const
Return this timestamp's subseconds component, converted to microseconds.
Definition timestamp.hh:1109
seconds_type sec() const
Return this timestamp's seconds component.
Definition timestamp.hh:1075
void assign_now()
Set this timestamp to the current system time.
Definition timestamp.hh:952
static Timestamp make_nsec(value_type nsec)
Return a timestamp representing nsec nanoseconds.
Definition timestamp.hh:370
static uint32_t msec_to_subsec(uint32_t msec)
Convert milliseconds to subseconds.
Definition timestamp.hh:523
void set_sec(seconds_type sec)
Set this timestamp's seconds component.
Definition timestamp.hh:1048
static Timestamp make_sec(seconds_type sec)
Return a timestamp representing sec seconds.
Definition timestamp.hh:326
uint32_t subsec() const
Return this timestamp's subseconds component.
Definition timestamp.hh:1089
Timestamp(const rep_t &rep)
Construct a Timestamp from its internal representation.
Definition timestamp.hh:215
Timestamp usec_ceil() const
Return the next microsecond-valued timestamp no smaller than *this.
Definition timestamp.hh:303
static Timestamp recent()
Return a recent system time.
Definition timestamp.hh:972
friend Timestamp & operator-=(Timestamp &a, const Timestamp &b)
Subtract b from a.
Definition timestamp.hh:1353
void assign_now_nouser(bool steady)
Set this timestamp to the current clock time without calling the user clock if one is set.
Definition timestamp.hh:1008
click_jiffies_t jiffies() const
Return the number of jiffies represented by this timestamp.
Definition timestamp.hh:1166
value_type usecval() const
Return this timestamp's interval length in microseconds.
Definition timestamp.hh:281
struct timeval timeval() const
Return a struct timeval that approximates this timestamp.
Definition timestamp.hh:1542
Timestamp(unsigned sec, uint32_t subsec=0)
Definition timestamp.hh:202
bool operator>=(const Timestamp &a, const Timestamp &b)
Compare two timestamps.
Definition timestamp.hh:1303
static uint32_t usec_to_subsec(uint32_t usec)
Convert microseconds to subseconds.
Definition timestamp.hh:527
static uint32_t subsec_to_msec(uint32_t subsec)
Convert subseconds to milliseconds.
Definition timestamp.hh:535
struct timeval timeval_ceil() const
Return the minimum struct timeval >= this timestamp.
Definition timestamp.hh:1556
Timestamp msec_ceil() const
Return the next millisecond-valued timestamp no smaller than *this.
Definition timestamp.hh:298
void assign_usec(seconds_type sec, uint32_t usec)
Definition timestamp.hh:405
Type wrapper for the constant true.
Functions for manipulating integers.
uint32_t int_divide(uint32_t a, uint32_t b)
Return a / b.
Definition integers.hh:354
uint32_t int_remainder(uint32_t a, uint32_t b, uint32_t ")
Divide a / b, placing quotient in quot and returning remainder.
Definition integers.hh:445
Template determining whether T may be copied by memcpy.
Definition type_traits.hh:66
bool operator>=(const Timestamp &a, int b)
Definition timestamp.hh:1310
Timestamp & operator+=(Timestamp &a, const Timestamp &b)
Add b to a.
Definition timestamp.hh:1337
bool cp_time(const String &str, Timestamp *result, bool allow_negative)
Parse a timestamp from str.
Definition confparse.cc:1526
bool operator>(const Timestamp &a, int b)
Definition timestamp.hh:1328
Timestamp operator+(Timestamp, const Timestamp &)
Add the two operands and return the result.
Definition timestamp.hh:1367
Timestamp operator/(const Timestamp &a, double b)
Scale a down by a factor of b and return the result.
Definition timestamp.hh:1484
Timestamp operator*(const Timestamp &a, double b)
Scale a by a factor of b and return the result.
Definition timestamp.hh:1447
Timestamp operator-(Timestamp a, const Timestamp &b)
Subtract b from a and return the result.
Definition timestamp.hh:1375
bool operator<(const Timestamp &a, int b)
Definition timestamp.hh:1274
Timestamp & operator-=(Timestamp &a, const Timestamp &b)
Subtract b from a.
Definition timestamp.hh:1353
bool operator<=(const Timestamp &a, int b)
Definition timestamp.hh:1292
Type of a Timestamp representation.
Definition timestamp.hh:552