Guest User

Untitled

a guest
Nov 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. clock_t start;
  2. clock_t end;
  3. double cpu_time_used;
  4. float getal = 0;
  5.  
  6. start = clock();
  7. for(int i=0; i<100000000; i++) {
  8. getal += 1;
  9. }
  10. end = clock();
  11. cpu_time_used = (((double) (end-start)) / CLOCKS_PER_SEC) / 100000000;
  12.  
  13. printf("Addition time: %e\n", cpu_time_used);
Add Comment
Please, Sign In to add comment