---
title: "MPSSetHeapCacheDuration(_:_:)"
framework: metalperformanceshaders
role: symbol
role_heading: Function
path: "metalperformanceshaders/mpssetheapcacheduration(_:_:)"
---

# MPSSetHeapCacheDuration(_:_:)

Sets the timeout after which unused cached Metal heaps are released.

## Declaration

```swift
func MPSSetHeapCacheDuration(_ cmdBuf: any MTLCommandBuffer, _ seconds: Double)
```
