I have been looking for an exact Win implémentation of the patch of code below. I am not a great programmer and the code I have was initially in UNix but I have to modify it as little as possible for Win. I understand from some googling that the main problem is "gettimeofday" for which there no Win equivalent. Howver I would like to retain the same program structure as much as possible.
struct timeval tv;
time_t curtime;
gettimeofday(&tv, NULL); // ???
curtime = tv.tv_usec;
srand(tv.tv_usec); //time(&curtime)