1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Timers: Parse and format functions for microsecond times

Date/time output (e.g. in logs, show commands) can use %f to specify
subsecond time. By default, millisecond precision is used in output.
This commit is contained in:
Ondrej Zajicek (work)
2017-06-06 16:47:30 +02:00
parent 025525266f
commit f047271cb9
21 changed files with 244 additions and 193 deletions

View File

@@ -45,18 +45,6 @@ static inline timer * tm_new_set(pool *p, void (*hook)(timer *), void *data, uin
{ return tm2_new_init(p, hook, data, rec S_, rand S_); }
struct timeformat {
char *fmt1, *fmt2;
bird_clock_t limit;
};
bird_clock_t tm_parse_date(char *); /* Convert date to bird_clock_t */
bird_clock_t tm_parse_datetime(char *); /* Convert date to bird_clock_t */
#define TM_DATETIME_BUFFER_SIZE 32 /* Buffer size required by tm_format_datetime */
void
tm_format_datetime(char *x, struct timeformat *fmt_spec, bird_clock_t t);
#define TIME_INFINITY ((s64) 0x7fffffffffffffff)