# what units are used in kern.cp_times?



## hsn (Apr 13, 2012)

I need to get CPU miliseconds used since boot. Total user + system + interrupt time. My idea is to get it from the cp_times counter, but *I* could not figure out what time units are used.


```
kern.cp_times: 99980046 216471 24984081 1176383 1487354560 71668989 126252 23494859 10703 1518410383
 131623419 250473 23864059 96 1457972935 118043958 142876 19560244 58 1475964202 122076248 131112 18928452
 113 1472575112 112635562 103018 16450420 111 1484522108 92257836 132166 24627838 306285 1496387411
 49457466 59102 14902169 989885 1548302924
```

*S*ource code is in sys/kern/kern_clock.c


----------



## SirDice (Apr 13, 2012)

I'm not sure but it's probably a jiffy.


----------



## hsn (Apr 14, 2012)

*U*nits seems to be closest to stathz, but in reality they are slightly faster then 133 Hz.


```
ponto:(admin)main/swg>[I]sysctl kern.clockrate[/I]
kern.clockrate: { hz = 1000, tick = 1000, profhz = 2000, [B]stathz[/B] = 133 }
```


----------

