Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » GetCurrentThreadCpuTime
GetCurrentThreadCpuTime [message #93465] Wed, 14 March 2007 09:41 Go to next message
Eclipse UserFriend
Originally posted by: schlossh.fh-trier.de

Hi everyone,

I would like to access the JVMTI's GetCurrentThreadCPUTime method from
within my Java-Application, just like it is described for JVMPI in
http://www.javaworld.com/javaworld/javatips/jw-javatip92.htm l?page=3. Do you
have any idea how it could work?

Thank you

Hermann
Re: GetCurrentThreadCpuTime [message #93496 is a reply to message #93465] Wed, 14 March 2007 15:28 Go to previous message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Hermann Schloss wrote:
> Hi everyone,
>
> I would like to access the JVMTI's GetCurrentThreadCPUTime method from
> within my Java-Application, just like it is described for JVMPI in
> http://www.javaworld.com/javaworld/javatips/jw-javatip92.htm l?page=3. Do you
> have any idea how it could work?
>
> Thank you
>
> Hermann
>
>

Literally, JVMTI functions such as GetCurrentThreadCPUTime cannot be
accessed from a pure Java application. However, you can use the same
technique described in the included link to expose some JVMTI functions
to a Java program through JNI. Converting the example to JVMTI is pretty
straightforward. Take a look at the following link for an introduction
on how to write JVMTI agents:
http://java.sun.com/developer/technicalArticles/J2SE/jvm_ti/


HTH,
Asaf


--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Previous Topic:Get exact CPU time of a Java Application
Next Topic:Finding the Declaring Class in MethodInvocation
Goto Forum:
  


Current Time: Mon Sep 28 19:00:06 GMT 2020

Powered by FUDForum. Page generated in 0.05356 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top