---
schema_version: "1"
id: 265c6bee72632a2b8b53a67bbd78deb730c0dde509bd6de9edf16bd4be947298
title: time
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-timer-functions-time.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-timer-functions-time
source_site: docs.mulesoft.com
content_type: documentation
content_hash: aab9de181d5d7a901109217d6cc23187753b5841a0077e3cd61465208a087f48
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# time

## [](#time1)time<T>(valueToMeasure: () -> T): TimeMeasurement<T>

入力関数を実行し、その関数の実行の開始時刻と終了時刻が含まれる ​`TimeMeasurement`​ オブジェクトと関数の結果を返します。

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

<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>time</code>​ に渡す関数。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

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

```Dataweave
%dw 2.0
output application/json
fun myFunction() = dw::Runtime::wait("My result",100)
fun myFunction2() = sum([1,2,3,4])
---
{ testing: [
    dw::util::Timer::time(() -> myFunction()),
    dw::util::Timer::time(() -> myFunction2())
  ]
}
```

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

```XML
{
  "testing": [
    {
      "start": "2018-10-05T19:23:01.49Z",
      "result": "My result",
      "end": "2018-10-05T19:23:01.591Z"
    },
    {
      "start": "2018-10-05T19:23:01.591Z",
      "result": 10,
      "end": "2018-10-05T19:23:01.591Z"
    }
  ]
}
```