find CPU idle time

Can anybody help me out in finding the cpu time or cpu usage percentage for a particular process in windows xp environment.Any suggestion should be of a great help.ThanksMuthu
[203 byte] By [free-side-disha] at [2007-10-3 3:26:53]
# 1
You should receive performance information for your process such as moment of process creation and total CPU time spended. Then calculate anything.Look into MSDN and search HKEY_PERFORMANCE_DATA topics.
Michael.Nazarov@sun.coma at 2007-7-14 21:20:07 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Can this found using java?
free-side-disha at 2007-7-14 21:20:07 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

> Can this found using java?

Nope.

This is an OS specific question (Windows XP in your case).

Java cannot be useful in this area.

As already mentioned maybe the best way is to search at msdn.microsoft.com and google groups with appropriate keywords.

My experience with your specific issue is to use the WMI (Windows Management Instrumentation) Performance Counter Win32 Classes components which are a set of COM objects (available on NT/2K/XP/2K3/Vista) that allows to do all sort of administrative tasks with the OS.

One of these classes ([url http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_perfrawdata_perfproc_process.asp?frame=true]Win32_PerfRawData_PerfProc_Process class[/url]) is a performance counters that monitor running application program and system processes.

You should have a look at this post to know how to use this class:

http://groups.google.com/group/microsoft.public.win32.programmer.wmi/msg/ac8691a2f885f29e

By the way the microsoft.public.win32.programmer.wmi group is a good start to read/ask questions about WMI related issues.

To integrate your WMI solution with Java you have at least two solutions:

1- ( This is the simple solution. ) Create your vbs script (see the post above) then use Runtime.exec() to execute it and retrieve the appropriate information.

2- Use [url http://sourceforge.net/projects/jacob-project/]JACOB[/url] or any other Java COM bridge to instanciate and use

the COM object to retrieve the appropriate information.

Regards

jfbrierea at 2007-7-14 21:20:07 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4
Thanks a lot..:-).But i could not get ur hi-fi methods.
free-side-disha at 2007-7-14 21:20:07 > top of Java-index,Java HotSpot Virtual Machine,Specifications...