Re: HZ from userspace

From: Piotr JaroszyÅski
Date: Wed Aug 06 2008 - 18:07:58 EST


>> I want to be able to convert starttime from /proc/#/stat to absolute
>> time and it seems that I need HZ to do that as it is measured in
>> jiffies. How can I get HZ? I have seen some discussion about this but
>> haven't found a definite answer. procps is using some hacks do it and
>> I would prefer to avoid them.
>> I only need a solution for modern kernels, say 2.6.20+ if that matters.
>
> `man sysconf`, in particular you want sysconf(_SC_CLK_TCK).

manpage says it's obsolete and i read in some discussion that it only
returns the default and not the real HZ used.

--
Best Regards,
Piotr JaroszyÅski
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—