%dw 2.0
output application/json
fun myFunction() = dw::Runtime::wait("My result",100)
fun myFunction2() = sum([1,2,3,4])
---
{ testing: [
dw::util::Timer::time(() -> myFunction()),
dw::util::Timer::time(() -> myFunction2())
]
}
time
time<T>(valueToMeasure: () -> T): TimeMeasurement<T>
Executes the input function and returns a TimeMeasurement
object that
contains the start and end time for the execution of that function, as well
the result of the function.
Example
This example passes wait
and sum
functions (defined in the
header), which return their results in TimeMeasurement
objects.