From e7e89d2d57b9308884385c2e97bd750475385cc4 Mon Sep 17 00:00:00 2001 From: default Date: Wed, 28 Sep 2022 17:18:30 +0200 Subject: [PATCH] New function ftime(). --- html.c | 6 ++++++ snac.c | 9 +++++++++ snac.h | 1 + 3 files changed, 16 insertions(+) diff --git a/html.c b/html.c index 0ff00ea..d5af46a 100644 --- a/html.c +++ b/html.c @@ -522,6 +522,7 @@ d_char *html_timeline(snac *snac, char *list, int local) d_char *s = xs_str_new(NULL); xs_set *seen = xs_set_new(4096); char *v; + double t = ftime(); s = html_user_header(snac, s, local); @@ -540,6 +541,11 @@ d_char *html_timeline(snac *snac, char *list, int local) s = html_user_footer(snac, s); + { + xs *s1 = xs_fmt("\n", ftime() - t); + s = xs_str_cat(s, s1); + } + s = xs_str_cat(s, "\n\n"); xs_set_free(seen); diff --git a/snac.c b/snac.c index 3c9fd40..3140474 100644 --- a/snac.c +++ b/snac.c @@ -58,6 +58,15 @@ d_char *tid(int offset) } +double ftime(void) +/* returns the UNIX time as a float */ +{ + xs *ntid = tid(0); + + return atof(ntid); +} + + int validate_uid(char *uid) /* returns if uid is a valid identifier */ { diff --git a/snac.h b/snac.h index 2adde26..60322d4 100644 --- a/snac.h +++ b/snac.h @@ -23,6 +23,7 @@ d_char *xs_time(char *fmt, int local); #define xs_utc_time(fmt) xs_time(fmt, 0) d_char *tid(int offset); +double ftime(void); void srv_debug(int level, d_char *str); #define srv_log(str) srv_debug(0, str)