Created
February 7, 2018 04:14
-
-
Save mariacamilarg/e95022da84e2ea6234cdae721b9766e8 to your computer and use it in GitHub Desktop.
Calculate time in C
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> | |
clock_t start, end; | |
float cpu_time_used; | |
start = clock(); | |
/* Something to measure */ | |
end = clock(); | |
cpu_time_used = ((float) (end - start)) / CLOCKS_PER_SEC; | |
printf("Time = %f\n", cpu_time_used); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment