This commit is contained in:
2025-12-04 11:10:27 +03:00
parent d868810048
commit da9cd51e5c
4 changed files with 415 additions and 396 deletions

View File

@@ -51,7 +51,8 @@ static mcc_errcodes_t shortcmd(short_command_t *cmd);
/**
* @brief nanotime - monotonic time from first run
* @return time in seconds
* @return struct timespec by CLOCK_MONOTONIC but with setpoint by CLOCK_REALTIME on observations start
* FIXME: double -> struct timespec; on init: init t0 by CLOCK_REALTIME
*/
double nanotime(){
static double t0 = -1.;
@@ -63,6 +64,7 @@ double nanotime(){
t0 = (double)start.tv_sec + (double)start.tv_nsec * 1e-9
- (double)now.tv_sec - (double)now.tv_nsec * 1e-9;
}
DBG("ASK nanotime: %g", (double)now.tv_sec + (double)now.tv_nsec * 1e-9 + t0);
return (double)now.tv_sec + (double)now.tv_nsec * 1e-9 + t0;
}