public long getCumulativeCpuTime ( ) { if ( JIFFY_LENGTH_IN_MILLIS < 0 ) { return 0 ; } long incJiffies = 0 ; for ( ProcessInfo p : processTree . values ( ) ) { if ( p != null ) { incJiffies += p . dtime ; } } if ( incJiffies * JIFFY_LENGTH_IN_MILLIS < Integer . MAX_VALUE ) { // Ignore the values that are ridiculous cpuTime += incJiffies * JIFFY_LENGTH_IN_MILLIS ; } return cpuTime ; }
Get the CPU time in millisecond used by all the processes in the process - tree since the process - tree created