WOLFRAM

gives the number of seconds remaining until the earliest enclosing TimeConstrained will request the current computation to stop.

Details

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

After 1 second has elapsed, there are still 4 seconds remaining until the 5 second time constraint:

Out[1]=1

Do not play this audio if there is not enough time to finish it:

Out[1]=1

Properties & Relations  (4)Properties of the function, and connections to other functions

Without an enclosing TimeConstrained, TimeRemaining[] returns Infinity:

Out[1]=1

TimeRemaining[] returns the time to the earliest time constraint:

Out[1]=1
Out[2]=2

After 2 seconds, there are 3 seconds remaining until the outer constraint of 5 seconds:

Out[3]=3

TimeRemaining is based on absolute time ("wall clock time"), as measured by AbsoluteTiming:

Out[1]=1

The CPU time taken by the operation can be measured using Timing, and it is smaller:

Out[2]=2

The presence of AbortProtect may invalidate the times reported by TimeRemaining[]:

Out[1]=1
Wolfram Research (2020), TimeRemaining, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeRemaining.html.
Wolfram Research (2020), TimeRemaining, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeRemaining.html.

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2024_timeremaining, author="Wolfram Research", title="{TimeRemaining}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/TimeRemaining.html}", note=[Accessed: 10-January-2025 ]}

@misc{reference.wolfram_2024_timeremaining, author="Wolfram Research", title="{TimeRemaining}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/TimeRemaining.html}", note=[Accessed: 10-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_timeremaining, organization={Wolfram Research}, title={TimeRemaining}, year={2020}, url={https://reference.wolfram.com/language/ref/TimeRemaining.html}, note=[Accessed: 10-January-2025 ]}

@online{reference.wolfram_2024_timeremaining, organization={Wolfram Research}, title={TimeRemaining}, year={2020}, url={https://reference.wolfram.com/language/ref/TimeRemaining.html}, note=[Accessed: 10-January-2025 ]}