PersistenceTime

PersistenceTime

is an option for various functions that specifies when a persistent value should be treated as expired.

Details

  • PersistenceTime can be used for PersistentSymbol and InitializationValue.
  • Values can be given as relative times in seconds or relative date and time specifications.
  • Values are typically converted to absolute times based on the current time.
  • The value Infinity () can be used to specify that a persistent value should never expire.
  • An expired persistent value is treated as nonexistent, and the underlying persistent object may be removed.

Examples

open allclose all

Basic Examples  (1)

Define a persistent value that expires in 5 seconds:

After 5 seconds, it is no longer used:

Scope  (2)

Define a persistent value that expires in 1 minute:

Numbers are treated as seconds:

Define a persistent value that expires in 5 days:

A persistence time of Infinity causes the value to never expire:

Properties & Relations  (2)

Values specified with PersistenceTime are converted to absolute expiration dates:

The default setting for PersistenceTime is to never expire:

Wolfram Research (2017), PersistenceTime, Wolfram Language function, https://reference.wolfram.com/language/ref/PersistenceTime.html.

Text

Wolfram Research (2017), PersistenceTime, Wolfram Language function, https://reference.wolfram.com/language/ref/PersistenceTime.html.

CMS

Wolfram Language. 2017. "PersistenceTime." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PersistenceTime.html.

APA

Wolfram Language. (2017). PersistenceTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PersistenceTime.html

BibTeX

@misc{reference.wolfram_2024_persistencetime, author="Wolfram Research", title="{PersistenceTime}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/PersistenceTime.html}", note=[Accessed: 12-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_persistencetime, organization={Wolfram Research}, title={PersistenceTime}, year={2017}, url={https://reference.wolfram.com/language/ref/PersistenceTime.html}, note=[Accessed: 12-October-2024 ]}