Include 'running since' in the footer

This commit is contained in:
kamkow1
2025-06-18 02:00:52 +02:00
parent a90517c4da
commit e9a95c2c54
9 changed files with 56 additions and 3 deletions

24
timer.c Normal file
View File

@ -0,0 +1,24 @@
#include <time.h>
#include <stddef.h>
#include <stdio.h>
#include "timer.h"
time_t rawtime;
void start_timer(void)
{
time(&rawtime);
}
void get_timer_string(char *output, size_t size)
{
struct tm * timeinfo;
timeinfo = localtime(&rawtime);
snprintf(output, size, "[%02d %02d %d %02d:%02d:%02d]", timeinfo->tm_mday,
timeinfo->tm_mon + 1, timeinfo->tm_year + 1900,
timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
}