cpuinformationmonitor.java

来自「分布式计算平台P2HP-1的源代码;P2HP-1是基于P2P的高性能计算平台」· Java 代码 · 共 42 行

JAVA
42
字号
package cn.edu.hust.cgcl.biogrid.dispatcher;

//import hpc.application.SubProgram;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class CpuInformationMonitor
{
    public native String displayCpuUsage();

    static
    {
    	//Runtime runTime = Runtime.getRuntime();
		//runTime.load(SubProgram.programPath+"\\alignment.dll"); 
        System.loadLibrary("cpumonitor");
    }

    public CpuInformationMonitor()
    {
    }

    public synchronized String getCpuUsage()
    {
    String u=new CpuInformationMonitor().displayCpuUsage();
    return u;
    }


    /*public static void main(String[] args)
    {
        String u=new CpuInformationMonitor().displayCpuUsage();
        System.out.println(u);
    }*/

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?