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));
    }
}
1

There are 1 best solutions below

2
On BEST ANSWER

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.