Skip to content

Instantly share code, notes, and snippets.

@joe-sullivan
Last active April 10, 2017 18:55
Show Gist options
  • Save joe-sullivan/31a4559d6bd668d192719caac2e7481f to your computer and use it in GitHub Desktop.
Save joe-sullivan/31a4559d6bd668d192719caac2e7481f to your computer and use it in GitHub Desktop.
Timing macro c
#include <stdio.h>
#include <time.h>
#define TIMING(func) {\
int start=clock();\
func;\
int diff = clock() - start;\
int msec = diff * 1000 / CLOCKS_PER_SEC;\
printf("ms: %d\n", msec);\
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment