3

Look at method 'methodExit'. What units of time are held in parameter "@Duration long time"?

package com.sun.btrace.samples;

import com.sun.btrace.Profiler;
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
import java.awt.EventQueue;
import java.awt.AWTEvent;
import java.awt.event.FocusEvent;

@BTrace
public class AllMethods {

    @OnMethod(
        clazz="java.awt.EventQueue",
        method="dispatchEvent",
        location=@Location(Kind.RETURN))
    public static void methodExit(@Duration long time, @ProbeMethodName String pmn) {
        println(pmn + " " + (time / 1000000));
    }
}
Wojciech Wirzbicki
  • 3,887
  • 6
  • 36
  • 59

1 Answers1

5

The duration is measured in nanoseconds.

The javadoc is missing this information - I have filed an issue for that. If you want to dig in the sources this place is a good start.

JB-
  • 2,615
  • 18
  • 17
  • 1
    It would be great if you could add a source to prove your answer is right so that others can learn more about this if they want. A short answer like this might be mistaken as not being an answer at all (although it does answer the question in this case). – Aurora0001 Feb 10 '17 at 18:44
  • @JB- Could you provide any reference to documentation or source code? – Wojciech Wirzbicki Feb 13 '17 at 11:04