Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #include <stdio.h>
- int main(int argc, char **argv) {
- volatile register i = 0;
- clock_t start = clock();
- printf("start=%i\n", start);
- __asm__(" movl $0xFFFFFFFF, %eax");
- __asm__(" mov $0, %ecx");
- __asm__("increment:");
- __asm__(" decl %eax");
- __asm__(" cmp %eax, %ecx");
- __asm__(" jne increment");
- clock_t stop = clock();
- printf("stop=%i\n", stop);
- printf("CLOCKS_PER_SEC=%i\n", CLOCKS_PER_SEC);
- printf("Completed in %i clocks.\n", stop - start);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement