net.i2p.router

## Class JobTiming

- java.lang.Object
- - net.i2p.router.JobTiming

- All Implemented Interfaces:
    Clock.ClockUpdateListener

      public class JobTiming
      extends Object
      implements Clock.ClockUpdateListener

  Define the timing requirements and statistics for a particular job For use by the router only. Not to be used by applications or plugins.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobTiming(RouterContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `end()` Mark the job as finished, recording the current time as the actual end time.
    `long` | `getActualEnd()` Get the actual end time when the job finished execution.
    `long` | `getActualStart()` Get the actual start time when the job began execution.
    `long` | `getStartAfter()` Get the scheduled start time for the job.
    `void` | `offsetChanged(long delta)` Adjust all timing values by the specified delta.
    `void` | `setActualEnd(long actualEndTime)` Set the actual end time when the job finished execution.
    `void` | `setActualStart(long actualStartTime)` Set the actual start time when the job began execution.
    `void` | `setStartAfter(long startTime)` Set the scheduled start time for the job.
    `void` | `start()` Mark the job as started, recording the current time as the actual start time.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JobTiming

          public JobTiming(RouterContext context)

  - ### Method Detail

    - #### end

          public void end()

      Mark the job as finished, recording the current time as the actual end time. Uses the router context clock for consistency.

    - #### getActualEnd

          public long getActualEnd()

      Get the actual end time when the job finished execution.
      Returns:
        milliseconds after the epoch when the job actually ended, or 0 if not yet ended

    - #### getActualStart

          public long getActualStart()

      Get the actual start time when the job began execution.
      Returns:
        milliseconds after the epoch when the job actually started, or 0 if not yet started

    - #### getStartAfter

          public long getStartAfter()

      Get the scheduled start time for the job.
      Returns:
        milliseconds after the epoch when the job should start

    - #### offsetChanged

          public void offsetChanged(long delta)

      Adjust all timing values by the specified delta. Used when the router clock is adjusted (e.g., NTP sync).
      Specified by:
        `offsetChanged` in interface `Clock.ClockUpdateListener`
      Parameters:
        `delta` - milliseconds to add to all timing values (positive or negative)

    - #### setActualEnd

          public void setActualEnd(long actualEndTime)

      Set the actual end time when the job finished execution.
      Parameters:
        `actualEndTime` - milliseconds after the epoch when the job actually ended

    - #### setActualStart

          public void setActualStart(long actualStartTime)

      Set the actual start time when the job began execution.
      Parameters:
        `actualStartTime` - milliseconds after the epoch when the job actually started

    - #### setStartAfter

          public void setStartAfter(long startTime)

      Set the scheduled start time for the job. WARNING: This does not force a resort of the job queue. Always call JobImpl.requeue() instead if the job is already queued.
      Parameters:
        `startTime` - milliseconds after the epoch when the job should start

    - #### start

          public void start()

      Mark the job as started, recording the current time as the actual start time. Uses the router context clock for consistency.