Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdint.h>
- #include <time.h>
- #include <unistd.h>
- volatile uint64_t a,b;
- int main()
- {
- int i;
- clock_t start,end,ended;
- for (i=0;i<10000000;i++){
- a = b * a * i;
- }
- start = clock();
- for (i=0;i<10000000;i++){
- a = b * a * i;
- }
- end = clock();
- sleep(1);
- ended = clock();
- printf("start %ld end %ld diff %ld\n", start, end, end-start);
- printf("end %ld ended %ld diff %ld\n", end, ended, ended-end);
- }
Add Comment
Please, Sign In to add comment