Skip to content

Instantly share code, notes, and snippets.

@matlink
Created February 16, 2018 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matlink/ac110edb1eb8b64c0f196617f42eb0d1 to your computer and use it in GitHub Desktop.
Save matlink/ac110edb1eb8b64c0f196617f42eb0d1 to your computer and use it in GitHub Desktop.
measure run time
#include <time.h>
clock_t begin = clock();
/* here, do your time-consuming job */
clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment