Skip to content

Instantly share code, notes, and snippets.

@cchudant
Last active November 29, 2019 06:10
Show Gist options
  • Save cchudant/cb7f33d14852c46f1acbded4999a5d21 to your computer and use it in GitHub Desktop.
Save cchudant/cb7f33d14852c46f1acbded4999a5d21 to your computer and use it in GitHub Desktop.
#include <time.h>
#define TIME(CALL) ({ \
clock_t _t = clock(); \
{ CALL; } \
printf("[timings]: \"%s\" took %fms\n", #CALL, \
((double)(clock() - _t)) / CLOCKS_PER_SEC * 1000.); \
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment