c - how to count cycles? -
i'm trying find find relative merits of 2 small functions in c. 1 adds loop, 1 adds explicit variables. functions irrelevant themselves, i'd teach me how count cycles compare algorithms. f1 take 10 cycles, while f2 take 8. that's kind of reasoning do. no performance measurements (e.g. gprof experiments) @ point, old instruction counting. is there way this? there tools? documentation? i'm writing c, compiling gcc on x86 architecture. http://icl.cs.utk.edu/papi/ papi_get_real_cyc(3) - return total number of cycles since arbitrary starting point