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

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