---
schema_version: "1"
id: 3cf42745f8762f8966de80f596f0c21b987e79a62b2a60430ecd9b17eeb2654d
title: Timer (dw::util::Timer)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-timer.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-timer
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f7ea0d5bd894fb02d7bb76e2d0499d197691c085ac7e687c34f2ac9e09c5e75e
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# Timer (dw::util::Timer)

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

This is a utility module.

The module is included with Mule runtime. To use it, you must import it into your DataWeave code,
for example, by adding the line `import * from dw::util::Timer` to the header of your script.

## Functions

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-timer-functions-currentmilliseconds">currentMilliseconds</a></p></td><td><p>Returns the current time in milliseconds.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-timer-functions-duration">duration</a></p></td><td><p>Executes the input function and returns an object with execution time in milliseconds and result of that function.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-timer-functions-time">time</a></p></td><td><p>Executes the input function and returns a <code>TimeMeasurement</code> object that contains the start and end time for the execution of that function, as well the result of the function.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-timer-functions-tomilliseconds">toMilliseconds</a></p></td><td><p>Returns the representation of a specified date-time in milliseconds.</p></td></tr></tbody></table>

## Types

- [Timer Types](https://docs.mulesoft.com/dataweave/2.3/dw-timer-types)
