title: getting cpu frequency (cycles per second)- 3 different ways:
body: <p>I have three calculation to get the curent cpu frequency: (cycles per second)</p>
  
  <pre><code>_initialCycles  = rdtsc(); //rdtsc function calculates the cpu cycles since init.
  
  
  first:
  ------
  unsigned int initialMillisec = (_timeVal.tv_sec)*1000+(_timeVal.tv_usec)/1000;
  unsigned int cps1 = ((_initialCycles / initialMillisec) * 1000);
  
  second:
  -------
  double initialMillisec2 = (_timeVal.tv_sec)*1000+(_timeVal.tv_usec)/1000.0;
  unsigned int cps2 = (unsigned int)(_initialCycles / initialMillisec2 * 1000.0);
  
  third:
  ------
  unsigned long long initialUsec3 = 
                  ((unsigned long long)(_timeVal.tv_sec))*1000000+_timeVal.tv_usec) ;
  unsigned int cps3 = (unsigned int)((_initialCycles / initialUsec3)* 1000000.0);
  </code></pre>
  
  <p>the thing is, cps1 cps2 cps3 suppose to have the same value, more or less..
  but they don't. I get:</p>
  
  <pre><code>cps1 = 2824048000
  cps2 = 3824609671
  cps3 = 8000000
  </code></pre>
  
  <p>anyone knows why?</p>