Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hashbrowncipher/cf6457d07eace75db371fe412d3a4bfe to your computer and use it in GitHub Desktop.
Save hashbrowncipher/cf6457d07eace75db371fe412d3a4bfe to your computer and use it in GitHub Desktop.
#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