Basically, the implementation of the clock() function has some freedom of action for different operating systems. On Linux, Fedora watches are faster. It extinguishes 1 million times per second.
This clock signal is different from the clock frequency of your processor, at a different level of abstraction. Windows is trying to make the number of clock cycles equal to the number of milliseconds .
This macro expands to an expression representing the number of hours ticking in a second as the clock function returns.
Dividing the clock count by this expression gives the number of seconds.
CLK_TCK is the deprecated alias of this macro.
Link: http://www.cplusplus.com/reference/clibrary/ctime/CLOCKS_PER_SEC/
You should also be aware that the Windows implementation is not intended for real -time applications . A time of 1000 ticks is obtained by dividing the hardware clock by a power of 2. This means that they actually receive a clock pulse of 1024 ha. To convert it to a tick of 1000 ticks, Windows will skip some ticks, which means that some ticks are slower than others!
Separate hardware clocks (not processor clocks) are typically used for synchronization. Link: http://en.wikipedia.org/wiki/Real-time_clock
source share