mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-09-19 18:00:23 +03:00
New function ftime().
This commit is contained in:
parent
5647e675fd
commit
e7e89d2d57
6
html.c
6
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("<!-- %lf seconds -->\n", ftime() - t);
|
||||
s = xs_str_cat(s, s1);
|
||||
}
|
||||
|
||||
s = xs_str_cat(s, "</body>\n</html>\n");
|
||||
|
||||
xs_set_free(seen);
|
||||
|
9
snac.c
9
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 */
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user