title: Inline assembler execution time
body: <p>I would like to know how to count execution time of c++ inline assembler? 
  My problem is that the difference of Tickcounts is 0.</p>
  
  <p>Here is my cpp code:</p>
  
  <pre><code>const int N = 100000;
  short x[4*N];
  
  short a[4*N];
      for (int j=0;j&lt;4*N;j++) {
          x[j] = rand() % 1000;
          a[j] = rand() % 5000;
      }
  DWORD dwAStart = GetTickCount();
  
  __asm {
  
      xor eax,eax
  
          mov ecx,N
      xor esi,esi
  </code></pre>
  
  <p>a1:</p>
  
  <pre><code>        emms
      movq        mm1,qword ptr x[esi]
      movq        mm2,mm1
      punpcklwd   mm1,mm6
      punpckhwd   mm2,mm6
      movq        mm0,qword ptr a[esi]
      movq        mm3,mm0
      punpcklwd   mm0,mm6
      punpckhwd   mm3,mm6
      pmullw      mm0,mm1
  
      paddsw      mm0,mm3
  
      add esi , 8
      loop a1
  };
  DWORD dwAInterval = GetTickCount() - dwAStart;
  printf("Operation is completed through %d ms (Assembler)!\n", (int)dwAInterval); 
  </code></pre>