Logo Search packages:      
Sourcecode: kcpuload version File versions  Download package

int KCPUProc::userPercent (  )  const [inline]

The percentage of ticks between the last reading and the previous reading used by the user loop (compared to the nice, system and idle loops).

This is measured across all CPUs, CPU 0 and CPU 1 respectively. The CPU-specific routines should only be used if SMP is available.

Each of these routines involves a short arithmetical calculation. If you're paranoid about running time, you might want to cache the results.

Definition at line 151 of file kcpuproc.h.

References tot, and UT.

Referenced by KCPULoad::takeReadingInternal().

    return (tot > 0 ? (100 * (cUT - UT)) / tot : 0);

Generated by  Doxygen 1.6.0   Back to index