Created
June 28, 2018 07:56
-
-
Save hashbrowncipher/cf6457d07eace75db371fe412d3a4bfe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <time.h> | |
int main() { | |
struct timespec start; | |
struct timespec end; | |
clock_gettime(CLOCK_REALTIME, &start); | |
for(int i = 0; i < 5000000; i++) { | |
clock_gettime(CLOCK_REALTIME, &end); | |
} | |
printf("%lu %lu\n", end.tv_sec - start.tv_sec, end.tv_nsec - start.tv_nsec); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment