jdk/src/share/classes/sun/misc/PerformanceLogger.java
changeset 3111 fefdeafb7ab9
parent 715 f16baef3a20e
child 5506 202f599c92aa
--- a/jdk/src/share/classes/sun/misc/PerformanceLogger.java	Thu May 14 10:58:07 2009 -0700
+++ b/jdk/src/share/classes/sun/misc/PerformanceLogger.java	Fri Jun 12 14:56:32 2009 -0400
@@ -81,6 +81,7 @@
     private static Vector<TimeData> times;
     private static String logFileName = null;
     private static Writer logWriter = null;
+    private static long baseTime;
 
     static {
         String perfLoggingProp =
@@ -188,6 +189,16 @@
     }
 
     /**
+     * Sets the base time, output can then
+     * be displayed as offsets from the base time;.
+     */
+    public static void setBaseTime(long time) {
+        if (loggingEnabled()) {
+            baseTime = time;
+        }
+    }
+
+    /**
      * Sets the start time.
      * This version of the method is
      * given the time to log, instead of expecting this method to
@@ -281,7 +292,8 @@
                         TimeData td = times.get(i);
                         if (td != null) {
                             writer.write(i + " " + td.getMessage() + ": " +
-                                         td.getTime() + "\n");
+                                         (td.getTime() - baseTime) + "\n");
+
                         }
                     }
                 }