Last active
April 10, 2017 18:55
-
-
Save joe-sullivan/31a4559d6bd668d192719caac2e7481f to your computer and use it in GitHub Desktop.
Timing macro c
This file contains 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 <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