# -*- coding: utf-8 -*-
from __future__ import division
+import subprocess
__proc_keys__ = (
# see man 5 proc
'W': 'swapping',
}
+def get_clk_tck():
+ process = subprocess.Popen(['getconf', 'CLK_TCK'], shell=True, stdout=subprocess.PIPE)
+ if process.wait() != 0:
+ raise "getconf CLK_TCK failed"
+ return process[0]
+
+ #= 100 -> 1 tick = 1/100 seconds
+ # require libc-bin to be installed
+
class Stat(dict):
def __init__(self, processid):
dict.__init__(self)
def nice_stime(self):
return self['stime'] / 100
+
+if __name__ == '__main__':
+ print get_clk_tck()