Quantcast
Channel: VMware Communities : Popular Discussions - Hyperic User Forums
Viewing all articles
Browse latest Browse all 52618

Process Execution time display

$
0
0
I have written the following code

import org.hyperic.sigar.*;
import org.hyperic.sigar.ProcCpu;
public class ProcessWorking{
    public static void main(String args[]) throws SigarException{
        Sigar sigar = new Sigar();
        long id = sigar.getPid();
       
        ProcCpu cpu = sigar.getProcCpu(id);
       
        System.out.println(cpu.getLastTime());
    }
}


But the output which I get is

output
{User=50, LastTime=-893188, Percent=0.0, StartTime=1323862645000, Total=70, Sys=20}

I am not sure y the LastTime is coming in the negative value and what ever complex looping structure I run the Percent of CPU used is always 0.0,
Could anyone please help, with this? Thanks in advance

Viewing all articles
Browse latest Browse all 52618

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>