Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #include <stdio.h>
- int main(void)
- {
- int t;
- int s;
- clock_t start1, start2, end1, end2;
- double cpu_time_used1, cpu_time_used2;
- start1 = clock();
- t = ft_is_prime(10000);
- end1 = clock();
- cpu_time_used1 = ((double) (end1 - start1)) / CLOCKS_PER_SEC;
- printf("ft_is_prime took %f seconds to execute \n", cpu_time_used1);
- start2 = clock();
- s = ft_is_prime(32767);
- end2 = clock();
- cpu_time_used2 = ((double) (end2 - start2)) / CLOCKS_PER_SEC;
- printf("ft_is_prime took %f seconds to execute \n", cpu_time_used2);
- }
- /*
- ft_is_prime took 0.000002 seconds to execute
- ft_is_prime took 0.000000 seconds to execute
- */
Add Comment
Please, Sign In to add comment