---
title: init()
framework: foundation
role: symbol
role_heading: Initializer
path: foundation/urlsessiontaskmetrics/init()
---

# init()

Creates a task metrics instance.

## Declaration

```swift
init()
```

## Discussion

Discussion You should never need to create your own URLSessionTaskMetrics instances. If you are interested in task metrics, implement the urlSession(_:task:didFinishCollecting:) method of URLSessionTaskDelegate. The URLSession will collect task metrics for you and deliver them to this method.
