On windows should use <time.h> instead of <sys/time.h>.

In order to be able to build on windows I had to make those changes.