Advertisement
tari

Untitled

Apr 25th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <time.h>
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char **argv) {
  5.     volatile register i = 0;
  6.     clock_t start = clock();
  7.     printf("start=%i\n", start);
  8.    
  9.     __asm__(" movl $0xFFFFFFFF, %eax");
  10.     __asm__(" mov $0, %ecx");
  11.     __asm__("increment:");
  12.     __asm__(" decl %eax");
  13.     __asm__(" cmp %eax, %ecx");
  14.     __asm__(" jne increment");
  15.  
  16.     clock_t stop = clock();
  17.     printf("stop=%i\n", stop);
  18.     printf("CLOCKS_PER_SEC=%i\n", CLOCKS_PER_SEC);
  19.     printf("Completed in %i clocks.\n", stop - start);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement