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

# Timer (dw::util::Timer)

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

This utility module contains functions for measuring time.

To use this module, you must import it to your DataWeave code, for example, by adding the line
`import * from dw::util::Timer` to the header of your DataWeave 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.11/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.11/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.11/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.11/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.11/dw-timer-types)
