This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3cb489e115f3b398c343167d4359821a311123d5
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Sep 29 08:24:23 2025 +0100

    Revert "Use nanoseconds rather than milliseconds internally. Aligns with 
10.0.x+"
    
    This reverts commit 58fbfb3ba096d75093aacf8c5d52be514d280f62.
---
 java/org/apache/coyote/Request.java | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 639b326ba4..2de1201b87 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -23,7 +23,6 @@ import java.nio.charset.Charset;
 import java.time.Instant;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.servlet.ReadListener;
@@ -150,7 +149,7 @@ public final class Request {
 
     private long bytesRead = 0;
     // Time of the request - useful to avoid repeated calls to 
System.currentTime
-    private long startTimeNanos = -1;
+    private long startTime = -1;
     private Instant startInstant = null;
     private long threadId = 0;
     private int available = 0;
@@ -693,11 +692,7 @@ public final class Request {
     }
 
     public long getStartTime() {
-        return System.currentTimeMillis() - 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTimeNanos);
-    }
-
-    public long getStartTimeNanos() {
-        return startTimeNanos;
+        return startTime;
     }
 
     /**
@@ -707,12 +702,12 @@ public final class Request {
      */
     @Deprecated
     public void setStartTime(long startTime) {
-        startTimeNanos = System.nanoTime() + 
TimeUnit.MILLISECONDS.toNanos(startTime - System.currentTimeMillis());
+        this.startTime = startTime;
         startInstant = Instant.now();
     }
 
     public void markStartTime() {
-        startTimeNanos = System.nanoTime();
+        startTime = System.currentTimeMillis();
         startInstant = Instant.now();
     }
 
@@ -818,7 +813,7 @@ public final class Request {
         }
         allDataReadEventSent.set(false);
 
-        startTimeNanos = -1;
+        startTime = -1;
         startInstant = null;
         threadId = 0;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to