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

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