Created
November 14, 2014 06:16
-
-
Save zhangyuchi/5b8e45fcb65470e854fd to your computer and use it in GitHub Desktop.
get high jingdu time
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
#define _POSIX_C_SOURCE 199309L /*note it*/ | |
#include <time.h> | |
#include <stdio.h> | |
int main() | |
{ | |
float f=123.013; | |
for(int j=0; j<2; ++j) | |
{ | |
for(int i=0; i<10; ++i) | |
{ | |
struct timespec tp; | |
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp); | |
printf("clock=%d ", tp.tv_nsec); | |
} | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment