Is there an equivalent instruction to rdtsc in ARM? : <p>For my project <strong>I must use inline assembly instructions</strong> such as <strong>rdtsc</strong> to calculate the execution time of some C/C++ instructions.</p>

<p>The following code seems to work on Intel but not on ARM processors:</p>

<pre><code>{unsigned a, d;asm volatile("rdtsc" : "=a" (a), "=d" (d)); t0 = ((unsigned long)a) | (((unsigned long)d) &lt;&lt; 32);}
//The C++ statement to measure its execution time
{unsigned a, d;asm volatile("rdtsc" : "=a" (a), "=d" (d)); t1 = ((unsigned long)a) | (((unsigned long)d) &lt;&lt; 32);}
time = t1-t0;
</code></pre>

<p><strong>My question is:</strong></p>

<p>How to write an <strong>inline assembly code similar to the above</strong> (to calculate the execution elapsed time of an instruction) to work on ARM processors?</p>
