---
title: new()
framework: foundation
role: symbol
role_heading: Type Method
path: foundation/urlsessiontasktransactionmetrics/new()
---

# new()

Creates a new transaction metrics instance.

## Declaration

```swift
class func new() -> Self
```

## Discussion

Discussion You should never need to create your own URLSessionTaskTransactionMetrics instances. The URLSession creates task transaction metrics as part of the URLSessionTaskMetrics instance that it delivers to the urlSession(_:task:didFinishCollecting:) method of URLSessionTaskDelegate.

## See Also

### Creating transaction metrics

- [init()](foundation/urlsessiontasktransactionmetrics/init().md)
