Annotation Interface Timed


@Retention(RUNTIME) @Target(METHOD) public @interface Timed
An annotation for marking a method of an annotated object as timed.

Given a method like this:


     @Timed(name = "fancyName")
     public String fancyName(String name) {
         return "Sir Captain " + name;
     }
 

A timer for the defining class with the name fancyName will be created and each time the #fancyName(String) method is invoked, the method's execution will be timed.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, use the given name as an absolute name.
    The name of the timer.
  • Element Details

    • name

      String name
      The name of the timer.
      Default:
      ""
    • absolute

      boolean absolute
      If true, use the given name as an absolute name. If false, use the given name relative to the annotated class.
      Default:
      false