MemoryCacheElement.PollingInterval 屬性

定義

取得或設定表示時間間隔的值,快取實作經過這段時間間隔之後,就會將目前的記憶體負載與針對快取執行個體所設定的絕對記憶體限制和百分比記憶體限制進行比較。

public:
 property TimeSpan PollingInterval { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.InfiniteTimeSpanConverter))]
[System.Configuration.ConfigurationProperty("pollingInterval", DefaultValue="00:02:00")]
public TimeSpan PollingInterval { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.InfiniteTimeSpanConverter))>]
[<System.Configuration.ConfigurationProperty("pollingInterval", DefaultValue="00:02:00")>]
member this.PollingInterval : TimeSpan with get, set
Public Property PollingInterval As TimeSpan

屬性值

TimeSpan

時間間隔,快取實作每隔這個時間間隔,就會將目前的記憶體負載與針對快取執行個體所設定的絕對記憶體限制和百分比記憶體限制進行比較。 預設為兩分鐘。

屬性

備註

屬性 PollingInterval 會對應至 pollingInterval 專案的 namedCaches 組態屬性。 此組態屬性的設定會以 格式 HH:MM:SS 指定,而且可以從應用程式組態中的組態屬性讀取 pollingInterval 。 或者,當類別初始化時 MemoryCache ,可以傳遞值。

如需如何設定快取的詳細資訊,請參閱 < namedCaches > 元素 (Cache 設定)

適用於

另請參閱