// Code for communicating with the proxmark3 hardware.
 //-----------------------------------------------------------------------------
 
+#define _POSIX_C_SOURCE 199309L // need clock_gettime()
+
 #include "comms.h"
 
 #include <stdio.h>
 #include <pthread.h>
 #include <inttypes.h>
 #include <time.h>
+#include <sys/time.h>
 
 #include "uart.h"
 #include "ui.h"