I have a C program where I start using some SIMD optimizations for SPE (Cell processor), etc. I would like to somehow "time" how many cycles they need. One idea is to turn on / off and measure the entire runtime. But it is slow. I can also add between and before executing gettimeofday (& start, NULL) and so that the statements, but they are accurate, I think when you deal with more than milliseconds.
I wonder if it is possible to effectively measure nanoseconds per instruction, or just processor cycles or some other exact time measure.
source share