title: Using CPU counters versus gettimeofday?
body: <p>I'd like to profile some code in C using Linux. I usually just do the usual <code>gettimeofday()</code> functions, they're easy to put in, understandable, and portable. I've had someone ask me why not using CPU counters or RDTSC for profiling the code, but although I understand that RDTSC may be more precise, I cannot argue in favor or against one or the other. So, my question is: all else being equal, would people profile code with the usual time functions or the RDTSC?</p>