title: Cycle counts for nanosleep using RDTSC
body: <p>I am trying to see how many cycles does 1 nanosecond takes on my laptop.</p>
  
  <p>Laptop Config : </p>
  
  <ol>
  <li>Processor : Intel Centrino Duo 2.0 GHz ( T7200 )</li>
  <li>Memory : 2 GB</li>
  </ol>
  
  <p>Following are the counts :</p>
  
  <ol>
  <li>1 second takes : 1995198000 ( which is close to 2 billion ticks, which is OK )</li>
  <li>1 milli second : 2,159,460 ( close to 2 Million , which is OK)</li>
  <li>1 micro second : 507,408 ( Why ? )</li>
  <li>1 nano second  : 139,000 ( Why ? )</li>
  </ol>
  
  <p>Till 1 micro seconds the ticks are in accordance with Frequency. However, below that, it is not. Also, I can differentiate between 100 nsec and 200 nsec using the cycle counts reliably, not below that.</p>
  
  <p>Setup to measure :</p>
  
  <ol>
  <li>Measuring process is attached to one processor.</li>
  <li>Priority of process is set to highest.</li>
  <li>CPU is set to run at highest frequency all the time. </li>
  </ol>
  
  <p>Can anyone explain the reason ? Is it because of the sleep ( I am using nanosleep) being implemented in such way. ?</p>