 |
Flowgrind
Advanced TCP traffic generator
|
Go to the documentation of this file.
58 struct timespec now = {.tv_sec = 0, .tv_nsec = 0};
59 static struct timespec first = {.tv_sec = 0, .tv_nsec = 0};
60 static struct timespec last = {.tv_sec = 0, .tv_nsec = 0};
65 if (!first.tv_sec && !first.tv_nsec)
68 char timestamp[30] =
"";
69 ctimespec_r(&now, timestamp,
sizeof(timestamp),
true);
71 if (asprintf(strp,
"%s [+%8.6lf] (%8.6lf)", timestamp,
Functions to manipulate strings used by Flowgrind.
double time_diff(const struct timespec *tp1, const struct timespec *tp2)
Returns the time difference between two the specific points in time tp1 and tp2.
int debug_timestamp(char **strp)
Helper function for DEBUG_MSG macro.
void increase_debuglevel()
Decrease debug level.
const char * ctimespec_r(const struct timespec *tp, char *buf, size_t size, bool ns)
Converts timespec struct tp into a null-terminated string.
void decrease_debuglevel()
Decrease debug level.
Timing related routines used by Flowgrind.
unsigned debug_level
Global debug level for flowgrind controller and daemon.
int gettime(struct timespec *tp)
Returns the current wall-clock time with nanosecond precision.
Debugging routines for Flowgrind controller and daemon.