add: print

This commit is contained in:
2025-11-19 06:39:24 -06:00
parent ee09a2e099
commit ca80a82d96
6 changed files with 96 additions and 4 deletions

11
src/interval.c Normal file
View File

@ -0,0 +1,11 @@
#include <bits/types/struct_timeval.h>
double interval_to_ms(struct timeval const *t)
{
return (double)t->tv_sec * 1000.0 + (double)t->tv_usec / 1000.0;
}
double get_interval(struct timeval const *start, struct timeval const *stop)
{
return interval_to_ms(stop) - interval_to_ms(start);
}