Skip to content

Instantly share code, notes, and snippets.

@bricef
Created June 17, 2011 21:01
Show Gist options
  • Save bricef/1032336 to your computer and use it in GitHub Desktop.
Save bricef/1032336 to your computer and use it in GitHub Desktop.
Using timing macros
#include <timing.h>
#define DEBUG 1
// ...
{
TIMEIT_INIT(timer_name);
int i;
TIMEIT_START(timer_name);
for ( i = 0 ; i < 10000 ; i++ ){
my_time_critical_function();
}
TIMEIT_STOP(timer_name);
TIMEIT_SHOWME(timer_name);
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment