# duration

> The duration of the Particle System in seconds.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.ParticleSystemModule

```csharp
public float duration { get; set; }
```

### Remarks

You can only set this property when the Particle System is not playing.

### Examples

```csharp
using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
    private ParticleSystem ps;

    void Start()
    {
        ps = GetComponent<ParticleSystem>();
        ps.Stop(); // Cannot set duration whilst Particle System is playing

        var main = ps.main;
        main.duration = 10.0f;

        ps.Play();
    }
}
```
