fix timespec usage

This commit is contained in:
john30
2020-12-06 17:18:25 +01:00
parent e67d549525
commit 358d662e5d
+2 -1
View File
@@ -3,6 +3,7 @@
#include <fcntl.h>
#include <poll.h>
#include <sys/stat.h>
#include <time.h>
#include <termios.h>
#include <unistd.h>
#include <cstdlib>
@@ -208,7 +209,7 @@ typedef union
#define WAIT_RESPONSE_TIMEOUT_MILLIS 100
long long getTime() {
timespec_t ts;
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return ts.tv_sec*1000+ts.tv_nsec/1000000;
}