#include <sys/time.h> long currentMillis() { struct timeval tp; gettimeofday(&tp, NULL); return tp.tv_sec * 1000 + tp.tv_usec / 1000; // Convert the seconds to milliseconds by multiplying by 1000 // Convert the microseconds to milliseconds by dividing by 1000 }By the way:
#include <time.h> time_t now = time(NULL);Gives you the current time in seconds.