I am trying to see how many cycles does 1 nanosecond takes on my laptop.
Laptop Config :
- Processor : Intel Centrino Duo 2.0 GHz ( T7200 )
- Memory : 2 GB
Following are the counts :
- 1 second takes : 1995198000 ( which is close to 2 billion ticks, which is OK )
- 1 milli second : 2,159,460 ( close to 2 Million , which is OK)
- 1 micro second : 507,408 ( Why ? )
- 1 nano second : 139,000 ( Why ? )
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.
Setup to measure :
- Measuring process is attached to one processor.
- Priority of process is set to highest.
- CPU is set to run at highest frequency all the time.
Can anyone explain the reason ? Is it because of the sleep ( I am using nanosleep) being implemented in such way. ?