Class NanoDuration

  • All Implemented Interfaces:
    Duration, Statistic

    public class NanoDuration
    extends AbstractStatistic
    implements Duration
    Class that tracks the runtime of a task with System.nanoTime()
    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) long begin
      Tracking variables.
      (package private) long end
      Tracking variables.
    • Constructor Summary

      Constructors 
      Constructor Description
      NanoDuration​(java.lang.String key)
      Constructor.
    • Field Detail

      • begin

        long begin
        Tracking variables.
      • end

        long end
        Tracking variables.
    • Constructor Detail

      • NanoDuration

        public NanoDuration​(java.lang.String key)
        Constructor.
        Parameters:
        key - Key
    • Method Detail

      • getBegin

        public long getBegin()
        Description copied from interface: Duration
        Get the begin of the interval.
        Specified by:
        getBegin in interface Duration
        Returns:
        Begin
      • getEnd

        public long getEnd()
        Description copied from interface: Duration
        Get the end of the interval.
        Specified by:
        getEnd in interface Duration
        Returns:
        End
      • getDuration

        public long getDuration()
        Description copied from interface: Duration
        Get the duration of the interval.
        Specified by:
        getDuration in interface Duration
        Returns:
        Duration
      • formatValue

        public java.lang.String formatValue()
        Description copied from interface: Statistic
        Get a formatted version of the value, for output.
        Specified by:
        formatValue in interface Statistic
        Returns:
        Value