Linux system clock tick?

is there any system calls that you can invoke in order to get the system clock tick? This is for a soft real time application that we would like to develop. Any pointers is appreciated.

Reply to
Joseph
Loading thread data ...

getconf/sysconf and "CLK_TCK" might be what you want.

rick jones

--
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Reply to
Rick Jones

With Kernel 2.6 that is not that easy.

The define value HZ tells you the frequency value (in 1/sec) of the the "virtual" system clock. In kernel space this is the frequency of the Kernel hardware timer and the value the scheduling uses to calculate the time slices. Depending on the architecture the default is something between 100 and 1000. It can be changed in a header file before recompiling the Kernel. This of course needs to be done in a way that the hardware (timer and CPU) can handle it.

In user land the same define HZ can be another value, it actually always is 100. Things like jiffies are appropriately converted between user land and Kernel space by the APIs. This value _can_ be changed but it should not, as many user land software takes HZ = 100 for granted.

-Michael

Reply to
Michael Schnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.