Python: How to get number of mili seconds per jiffy

前端 未结 3 1343
自闭症患者
自闭症患者 2020-12-06 10:20

I\'d like to know the HZ of the system, i.e. how many mili seconds is one jiffy from Python code.

3条回答
  •  臣服心动
    2020-12-06 11:02

    sysconf(SC_CLK_TCK) does not give the frequency of the timer interrupts in Linux. It gives the frequency of jiffies which is visible to userspace in things like the counters in various directories in /proc

    The actual frequency is hidden from userspace, deliberately. Indeed, some systems use dynamic ticks or "tickless" systems, so there aren't really any at all.

    All the userspace interfaces use the value from SC_CLK_TCK, which as far as I can see is always 100 under Linux.

提交回复
热议问题