Minor changes

This commit is contained in:
Loic Guegan 2023-07-16 10:28:16 +02:00
parent 1028f22e16
commit 3ca57c9683
2 changed files with 11 additions and 1 deletions

View file

@ -9,6 +9,10 @@
#include "utils.h"
#include <time.h>
#ifndef LOGGER_DELAY
#define LOGGER_DELAY 0
#endif
// Global:
char *__client;
char __logdir[255];
@ -70,7 +74,9 @@ int main (int argc, char *argv [])
clock_gettime(CLOCK_REALTIME,&power_ts);
fprintf(logptr,"%d,%ld,%d\n",power_ts.tv_sec,power_ts.tv_nsec,power);
fseek(regptr,0,SEEK_SET);
sleep(1);
#if LOGGER_DELAY > 0
usleep(LOGGER_DELAY*1000);
#endif
printf("Tick\n"); fflush(stdout);
}
fclose(logptr);