# Is there a way to populate an excel spreadsheet with the elapsed time of a single step

**URL:** <https://forum.katalon.com/t/is-there-a-way-to-populate-an-excel-spreadsheet-with-the-elapsed-time-of-a-single-step/142771>\
**Category:** Integrations\
**Tags:** integrations, katalon-studio\
**Created:** [August 21, 2024, 6:56pm UTC](https://forum.katalon.com/t/is-there-a-way-to-populate-an-excel-spreadsheet-with-the-elapsed-time-of-a-single-step/142771 "2024-08-21T18:56:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [August 28, 2024, 11:50pm UTC](https://forum.katalon.com/t/is-there-a-way-to-populate-an-excel-spreadsheet-with-the-elapsed-time-of-a-single-step/142771/7 "2024-08-28T23:50:48Z")

</div>

I found that Katalon Studio bundles [Super CSV](https://super-csv.github.io/super-csv/index.html)  
See [How can I write values to a CSV file from Katalon Studio - #8 by kazurayam](http://forum.katalon.com/t/how-can-i-write-values-to-a-csv-file-from-katalon-studio/143788/8)  
I made a sample Test Case that utilized Super CSV

“Test Cases/TCx”

```auto
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.time.Duration
import java.time.LocalDateTime

import org.supercsv.io.CsvListWriter
import org.supercsv.prefs.CsvPreference

import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

LocalDateTime start = LocalDateTime.now()
WebUI.callTestCase(findTestCase("Test Cases/TC1"), [:]) // TC1 takes a few seconds to finish
LocalDateTime end = LocalDateTime.now()
Duration duration = Duration.between(start, end)

// report the duration
int nano = duration.getNano()
String secondsString = String.format("%.2f", nano / 1000000000)

Path projectDir = Paths.get(RunConfiguration.getProjectDir())
Path csvFile = projectDir.resolve("output.csv")

Writer writer = Files.newBufferedWriter(csvFile)
CsvListWriter clw = new CsvListWriter(writer, CsvPreference.EXCEL_PREFERENCE)

clw.write(Arrays.asList("memo","duration"))
clw.write(["calling \"TC1\" took", secondsString])

clw.flush()
clw.close()

```

output.csv

```auto
memo,duration
"calling ""TC1"" took",0.71

```

---

_[View the full topic](https://forum.katalon.com/t/is-there-a-way-to-populate-an-excel-spreadsheet-with-the-elapsed-time-of-a-single-step/142771)._
