You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2023/06/15 08:35:19 UTC

svn commit: r1910422 - /poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java

Author: centic
Date: Thu Jun 15 08:35:19 2023
New Revision: 1910422

URL: http://svn.apache.org/viewvc?rev=1910422&view=rev
Log:
Print out slightly more in SSPerformanceTest

Modified:
    poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java

Modified: poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java?rev=1910422&r1=1910421&r2=1910422&view=diff
==============================================================================
--- poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java (original)
+++ poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java Thu Jun 15 08:35:19 2023
@@ -70,21 +70,25 @@ public final class SSPerformanceTest {
 
         if(warmup) {
             System.out.println("Performing a warmup run first");
-            runWithArgs(type, rows, cols, saveFile);
+            runWithArgs(type, rows, cols, saveFile, System.currentTimeMillis());
         }
 
+        System.out.println("Performing test-run");
         long timeStarted = System.currentTimeMillis();
-        runWithArgs(type, rows, cols, saveFile);
+        runWithArgs(type, rows, cols, saveFile, timeStarted);
         long timeFinished = System.currentTimeMillis();
 
         System.out.printf(Locale.ROOT, "Elapsed %.2f seconds for arguments %s%n", ((double)timeFinished - timeStarted) / 1000, Arrays.toString(args));
     }
 
-    private static void runWithArgs(String type, int rows, int cols, boolean saveFile) throws IOException {
+    private static void runWithArgs(String type, int rows, int cols, boolean saveFile, long timeStarted) throws IOException {
         try (Workbook workBook = createWorkbook(type)) {
             boolean isHType = workBook instanceof HSSFWorkbook;
             addContent(workBook, isHType, rows, cols);
 
+            long timeFinished = System.currentTimeMillis();
+            System.out.printf(Locale.ROOT, "Elapsed %.2f seconds before save%n", ((double)timeFinished - timeStarted) / 1000);
+
             if (saveFile) {
                 String fileName = type + "_" + rows + "_" + cols + "." + getFileSuffix(type);
                 saveFile(workBook, fileName);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org