]> source.dussan.org Git - poi.git/commitdiff
Print out slightly more in SSPerformanceTest
authorDominik Stadler <centic@apache.org>
Thu, 15 Jun 2023 08:35:19 +0000 (08:35 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 15 Jun 2023 08:35:19 +0000 (08:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910422 13f79535-47bb-0310-9956-ffa450edef68

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

index 0c0e44035760163938df132636d93be9e9bd0df1..ce9aed911502bff804337cad81719ec0df8cb195 100644 (file)
@@ -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);