diff options
author | Dominik Stadler <centic@apache.org> | 2023-06-15 08:35:19 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2023-06-15 08:35:19 +0000 |
commit | 9556080d384c6b6f9ee71a5c9707f8bbfea885c6 (patch) | |
tree | c4886333caedb2bbd7e7d781454ba12530220f84 | |
parent | 6943cc9a9c8528ca47bba2a499e408e41f0c893e (diff) | |
download | poi-9556080d384c6b6f9ee71a5c9707f8bbfea885c6.tar.gz poi-9556080d384c6b6f9ee71a5c9707f8bbfea885c6.zip |
Print out slightly more in SSPerformanceTest
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910422 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java index 0c0e440357..ce9aed9115 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/SSPerformanceTest.java @@ -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); |