---
title: "module::setLifetime"
framework: Compute Graph
role: symbol
role_heading: Function
platforms: [iOS 27.0+, iPadOS 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: computegraph/module/setlifetime
---

# module::setLifetime

Sets the lifetime of an element in seconds.

## Declaration

```swift
void module::setLifetime(float lifetime)
```

## Parameters

- `lifetime`: The duration in seconds the element should remain active

## Discussion

Discussion Use this function to control how long an element will exist before being automatically removed from the system. note:
