Contact Free trial Login


time(() -> 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.


Name Description


A function to pass to time.


This example passes wait and sum functions (defined in the header), which return their results in TimeMeasurement objects.

%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())


  "testing": [
      "start": "2018-10-05T19:23:01.49Z",
      "result": "My result",
      "end": "2018-10-05T19:23:01.591Z"
      "start": "2018-10-05T19:23:01.591Z",
      "result": 10,
      "end": "2018-10-05T19:23:01.591Z"

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.