Enum Counter.Type

    • Enum Constant Detail

      • WALL_CLOCK_TIME

        public static final Counter.Type WALL_CLOCK_TIME
        The elapsed time experienced by a user waiting for a task to complete.
      • CPU_TIME

        public static final Counter.Type CPU_TIME
        The total time spent using a CPU for the current thread.
      • USER_TIME

        public static final Counter.Type USER_TIME
        The total CPU time that the current thread has executed in user mode (i.e., the time spent running current thread's code).
      • SYSTEM_TIME

        public static final Counter.Type SYSTEM_TIME
        The time spent by the OS kernel to execute system level operations on behalf of the application, such as context switching, resource allocation, etc.
    • Method Detail

      • values

        public static Counter.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Counter.Type c : Counter.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Counter.Type valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getTime

        public abstract long getTime()
        Executes a particular time fetching mode that varies for each counter type.
        Returns:
        the amount of time at the current instant, in nanoseconds.