Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #include <stdio.h>
- int main(void)
- {
- clock_t begin = clock();
- int a = 1 + 1;
- clock_t end = clock();
- double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
- printf("%f seconds\n", time_spent); // Returns something like 0.000002 seconds
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement