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

int KCPUProc::totalPercent (  )  const [inline]

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

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 171 of file kcpuproc.h.

References tot, and UT.

Referenced by KCPULoad::takeReadingInternal().

    return (tot > 0 ?
        (100 * ((cUT - UT) + (cST - ST) + (cNT - NT))) / tot : 0);

Generated by  Doxygen 1.6.0   Back to index