Project Finished

This commit is contained in:
2024-10-19 15:45:40 +05:30
parent 6114206eb7
commit 3ae6a02a3e
19 changed files with 1601 additions and 24 deletions

26
asyncproject/utils.c Normal file
View File

@@ -0,0 +1,26 @@
#include "utils.h"
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
char*
hrs_min_sec_format(unsigned int seconds) {
static char time_f[16];
unsigned int hrs = 0,
min = 0, sec = 0;
if (seconds > 3600) {
min = seconds / 60;
sec = seconds % 60;
hrs = min / 60;
min = min % 60;
}
else {
min = seconds / 60;
sec = seconds % 60;
}
memset(time_f, 0, sizeof(time_f));
sprintf(time_f, "%u::%u::%u", hrs, min, sec);
return time_f;
}