Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-982

Use System.nanoTime() to measure time intervals

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core, Flume Appender
    • Labels:
      None

      Description

      Unlike System.currentTimeMillis(), which can jump/slew forward and backwards, System.nanoTime() is a monotonic clock (at least it should be) and hence it should be used to measure time intervals (timeouts/delays/etc).

        Attachments

        1. LOG4J2-982.patch
          15 kB
          Mikhail Mazurskiy
        2. LOG4J2-982-v2.patch
          20 kB
          Mikhail Mazurskiy
        3. LOG4J2-982-v3.patch
          20 kB
          Mikhail Mazurskiy
        4. LOG4J2-982-v4.patch
          20 kB
          Mikhail Mazurskiy
        5. flume-nano.diff
          5 kB
          Gary Gregory

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ash2k Mikhail Mazurskiy
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: