Created
February 25, 2017 20:39
-
-
Save arjankuijpers/9593308beec722e4c772dcbf3bcad7a4 to your computer and use it in GitHub Desktop.
current time stamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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