The Artima Developer Community
Sponsored Link

Java Answers Forum
how to get the processor speed info?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Adam Wu

Posts: 2
Nickname: depender
Registered: Dec, 2003

how to get the processor speed info? Posted: Dec 24, 2003 3:58 AM
Reply to this message Reply
Advertisement
Hi, all,

how to get the processor speed info using Java?
for example, one can get the processor info by the 'set' command as:

PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 1 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0102

but two problems here:

(1) does the PROCESSOR_LEVEL=15 really reflect the processor speed and hence a good
criteria to calculate/evaluate the CPU speed?
(2) it is a pity that the info got via System.getProperties() does notinclude these
PROCESSOR_* info

so, how can I get the processor speed info programmically using Java?


BTW: I am using JDK1.4.1_01, and the potential platforms include: Win98,Win2K,and XP.

Thanks.

my email: depender@yahoo.com

Adam




Posted at
bbs.xjtu
java

On Dec 16, 2003



Posted at Java Technology Forums


in :
*Forum: New To Java Technology
*Forum: Java Programming * No A
*Forum: Advanced Language Topics


On Dec 12, 2003

by dependerxgg



The other Threads can be found here
http://forum.java.sun.com/thread.jsp?forum=54&thread=474061&start=0&range=15#2195722
and here
http://forum.java.sun.com/thread.jsp?forum=4&thread=474064&start=0&range=15#2195719


Retreiving hardware informations
Author: 0102030400 Jul 16, 2002 8:17 AM

Hi all,

Is there any way to retrieve informations about the hardware in java, e.g. the processor (type, speed...), harddisks (capacity, freemem...) etc.

Thanks in advance, Mathias


Re: Retreiving hardware informations
Author: DrClap
In Reply To: Retreiving hardware informations Jul 16, 2002 10:15 AM

Reply 1 of 2


Yes, use JNI.


Re: Retreiving hardware informations
Author: Mordan
In Reply To: Retreiving hardware informations Jul 16, 2002 12:39 PM

Reply 2 of 2


> Hi all,
>
> Is there any way to retrieve informations about the
> hardware in java, e.g. the processor (type, speed...),
> harddisks (capacity, freemem...) etc.
>
> Thanks in advance, Mathias

well I think he is talking about pure,100% Java.

I also wanted to do so, but i have never found a solution that is pure Java.

I know though that they are commercial profiling packages. Look up on google.com


You can find some info about the RAM, but that's all.

Runtime rt = Runtime.getRuntime();
System.out.println("the maximum amount of memory that the virtual machine will attempt to use, measured in MegaBytes:"+rt.maxMemory()/1048576);
System.out.println("the total amount of memory currently available for current and future objects, measured in KiloBytes :"+rt.totalMemory()/1024);
System.out.println("an approximation to the total amount of memory currently available for future allocated objects, measured in KiloBytes:"+rt.freeMemory()/1024);
System.out.println("Number of processors:"+rt.availableProcessors());


That's not much i agree

Topic: Create a online bulletin board use JSP Previous Topic   Next Topic Topic: Any java web server(like tomcat) expert here?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use