Created
May 29, 2018 02:52
-
-
Save hashware/7756b381a83d97ce789c6bd98df2af4a to your computer and use it in GitHub Desktop.
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
static int cnt = 0; | |
cnt++; | |
{ | |
struct timeval now; | |
gettimeofday(&now, NULL); | |
uint64_t us0 = 0; | |
static uint64_t us1 = 0; | |
us0 = (uint64_t)now.tv_sec * 1000000 + (uint64_t)now.tv_usec; | |
if (us1 != us0) { | |
uint64_t x = us0 - us1; | |
if (cnt % 100 == 0) { | |
printf("frame: %d\n", x); | |
} | |
us1 = us0; | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment