AbsoluteTiming[expr]
evaluates expr, returning a list of the absolute number of seconds in real time that have elapsed, together with the result obtained.
AbsoluteTiming
AbsoluteTiming[expr]
evaluates expr, returning a list of the absolute number of seconds in real time that have elapsed, together with the result obtained.
Details
- AbsoluteTiming has attribute HoldAll.
- AbsoluteTiming[expr;] will give {timing,Null}.
- AbsoluteTiming is always accurate down to a granularity of $TimeUnit seconds, but on many systems is much more accurate.
- AbsoluteTiming[expr] measures only the time involved in actually evaluating expr, not time involved in formatting the result.
Examples
open all close allBasic Examples (2)
Get the total time to do a computation:
AbsoluteTiming[x = 1 + 2; Pause[x];x + 3]Timing just reports CPU time used:
Timing[x = 1 + 2; Pause[x];x + 3]AbsoluteTiming takes into account all time, including getting data over the internet if needed:
AbsoluteTiming[CountryData["France", "Population"]]The second time it is run is faster since the data has been saved for immediate reuse:
AbsoluteTiming[CountryData["France", "Population"]]Properties & Relations (1)
AbsoluteTiming has the attribute SequenceHold:
AbsoluteTiming[Sequence[10!, 40!]]See Also
Timing RepeatedTiming EchoTiming EvaluationData TimeConstrained SessionTime AbsoluteTime TimeConstraint $TimeUnit PingTime URLResponseTime
Function Repository: EchoPerformance
Tech Notes
Related Guides
History
Introduced in 2003 (5.0)
Text
Wolfram Research (2003), AbsoluteTiming, Wolfram Language function, https://reference.wolfram.com/language/ref/AbsoluteTiming.html.
CMS
Wolfram Language. 2003. "AbsoluteTiming." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AbsoluteTiming.html.
APA
Wolfram Language. (2003). AbsoluteTiming. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AbsoluteTiming.html
BibTeX
@misc{reference.wolfram_2026_absolutetiming, author="Wolfram Research", title="{AbsoluteTiming}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/AbsoluteTiming.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_absolutetiming, organization={Wolfram Research}, title={AbsoluteTiming}, year={2003}, url={https://reference.wolfram.com/language/ref/AbsoluteTiming.html}, note=[Accessed: 12-June-2026]}