#include <chrono>
#include <ctime>
#ifndef timeval
#include <sys/time.h>
#endif
#ifdef _WIN32
#include <winsock2.h> // for timeval