Using the MethodEntry
and MethodExit
event hooks provided by the JVMTI how would I measure the time of a method executed in Java?
In simple means it's just: time2 - time1
but the problem I see, how to I distinguish between the different methods? There is a methodID, but what about recursive calls? When is a method closed after it was opened?
Should I compare the stack trace? What would be a meaningful data structure to trace the methods which where entered? Something like Map<StackTrace,Time>?