---
schema_version: "1"
id: 0763c7f6f80d015a187d93b1c201e982755645bf65e0c0f5b2a730b7ace08283
title: Timer (dw::util::Timer)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-timer.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-timer
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 414dbd4951cdb769a68d45fff35b705169fc7fd924655cf584581698dfa5121c
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# 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/latest/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/latest/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/latest/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/latest/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/latest/dw-timer-types)
