Files
speedtest/src/utils.c
T
2025-11-20 18:15:23 +07:00

16 lines
268 B
C

#include "utils.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
void error(const char *msg) {
perror(msg);
exit(1);
}
double get_time_ms() {
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec * 1000.0) + (tv.tv_usec / 1000.0);
}