# TimePurgePredicate.ShouldPurgeFromTime(TimeSpan, TimeSpan)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.timepurgepredicate/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.timepurgepredicate/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/PooledCache/TimePurgePredicate.cs#L35)

```csharp
public virtual bool ShouldPurgeFromTime(TimeSpan timeInCache, TimeSpan relativeAge)
```

Checks to see if the message should be purged. Message should be purged if its relative age is greater than `maxRelativeMessageAge` and has been in the cache longer than the minTimeInCache.

### Parameters

- `timeInCache` (`TimeSpan`): The amount of time message has been in this cache
- `relativeAge` (`TimeSpan`): The age of message relative to the most recent events read

### Returns

`true` if the message should be purged; otherwise `false`.
