Question : c get time in milliseconds
Answered by : average-addax-adb1j512kcim
#include <sys/time.h>
long long current_timestamp() { struct timeval te; gettimeofday(&te, NULL); // get current time long long milliseconds = te.tv_sec*1000LL + te.tv_usec/1000; // calculate milliseconds // printf("milliseconds: %lld\n", milliseconds); return milliseconds;
}
Source : | Last Update : Sun, 13 Jun 21