---
schema_version: "1"
id: 18855e8952333971dacfde3e205a2cec2cb3570e7838e57c5479309555a1f00d
title: duration
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-timer-functions-duration.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-timer-functions-duration
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ccb326d9aa3e39cec7fcf9606f0c69f206caec023bf0828697beb835997babb6
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# duration

## [](#duration1)duration(() -> T): DurationMeasurement<T>

入力関数を実行し、その関数の実行時間 (ミリ秒) と結果を含むオブジェクトを返します。

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>valueToMeasure</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>duration</code>​ に渡す関数。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、​`wait`​ 関数 (ヘッダーで定義) を渡し、その関数の実行時間と結果を ​`DurationMeasurement`​ オブジェクトで返します。

#### [](#ソース)ソース

```Dataweave
%dw 2.0
output application/json
fun myFunction() = dw::Runtime::wait("My result",100)
---
dw::util::Timer::duration(() -> myFunction())
```

#### [](#出力)出力

```XML
{
  "time": 101,
  "result": "My result"
}
```