Skip to content

Instantly share code, notes, and snippets.

@arjankuijpers
Created February 25, 2017 20:39
Show Gist options
  • Save arjankuijpers/9593308beec722e4c772dcbf3bcad7a4 to your computer and use it in GitHub Desktop.
Save arjankuijpers/9593308beec722e4c772dcbf3bcad7a4 to your computer and use it in GitHub Desktop.
current time stamp
long long current_timestamp() {
struct timeval te;
gettimeofday(&te, NULL); // get current time
long long milliseconds = te.tv_sec*1000LL + te.tv_usec/1000; // caculate milliseconds
// printf("milliseconds: %lld\n", milliseconds);
return milliseconds;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment