Skip to content

Instantly share code, notes, and snippets.

@enjoylife
Created November 17, 2012 19:35
Show Gist options
  • Select an option

  • Save enjoylife/4099232 to your computer and use it in GitHub Desktop.

Select an option

Save enjoylife/4099232 to your computer and use it in GitHub Desktop.
clock C code
#include <time.h>
int main()
{
clock_t tic = clock();
my_expensive_function_which_can_spawn_threads();
clock_t toc = clock();
printf("Elapsed: %f seconds\n", (double)(toc - tic) / CLOCKS_PER_SEC);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment