I'm not quiet sure where if this is the right board to post this question, but I'll give it a try.
I'm working on finding an efficient implementation of an algorithm in C++. I have an algorithm to compare it with, so this far I've only been comparing them in runningtime. However I see that people often refer to the "number of cycles" when they talk about how much work is needed to do something. So; I'm not quiet sure what's ment by those cycles. Is this actual operations on the lowest level - like in the gates on hardware level? And are there some ways to measure the number of cycles used between two points in a C++ code?
I've been working on some assembly programming lately and I've seen authors speak about the number of cycles on assembly instructions as well (without further explanation..). So; is that how I measure the number of cycles on my algorithm? By checking the assemblycode generated when I compile my C++ program, and then counting the number of cycles for the instructions. Or is there a better way?.. Or am I just way of with all I've been saying here?
Any answers will be gladly accepted!