Created
November 17, 2012 19:35
-
-
Save enjoylife/4099232 to your computer and use it in GitHub Desktop.
clock C code
This file contains hidden or 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 <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