({{, (RefLink[AbsoluteTiming, paclet:ref/AbsoluteTiming])[expr]
evaluates expr, returning a list of the absolute number of seconds in real time that have elapsed, together with the result obtained. }})

OpenersNotesSection(Spacer1)Details

(RefLink[AbsoluteTiming, paclet:ref/AbsoluteTiming]) has attribute (RefLink[HoldAll, paclet:ref/HoldAll]).

(RefLink[AbsoluteTiming, paclet:ref/AbsoluteTiming])[expr;] will give {timing,(RefLink[Null, paclet:ref/Null])}.

(RefLink[AbsoluteTiming, paclet:ref/AbsoluteTiming]) is always accurate down to a granularity of (RefLink[$TimeUnit, paclet:ref/$TimeUnit]) seconds, but on many systems is much more accurate.

(RefLink[AbsoluteTiming, paclet:ref/AbsoluteTiming])[expr] measures only the time involved in actually evaluating expr, not time involved in formatting the result.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Get the total time to do a computation:

AbsoluteTiming[x = 1 + 2; Pause[x];x+3]

(RefLink[Timing, paclet:ref/Timing]) just reports CPU time used:

Timing[x = 1 + 2; Pause[x];x+3]

(RefLink[AbsoluteTiming, paclet:ref/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"]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Timing, paclet:ref/Timing])  ▪  (RefLink[RepeatedTiming, paclet:ref/RepeatedTiming])  ▪  (RefLink[EvaluationData, paclet:ref/EvaluationData])  ▪  (RefLink[TimeConstrained, paclet:ref/TimeConstrained])  ▪  (RefLink[SessionTime, paclet:ref/SessionTime])  ▪  (RefLink[AbsoluteTime, paclet:ref/AbsoluteTime])  ▪  (RefLink[TimeConstraint, paclet:ref/TimeConstraint])  ▪  (RefLink[$TimeUnit, paclet:ref/$TimeUnit])  ▪  (RefLink[PingTime, paclet:ref/PingTime])  ▪  (RefLink[URLResponseTime, paclet:ref/URLResponseTime])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Date and Time Functions, paclet:tutorial/DateAndTimeFunctions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Tuning & Debugging, paclet:guide/TuningAndDebugging])}, {▪(RefLinkPlain[Time Measurement & Optimization, paclet:guide/TimeMeasurementAndOptimization])}, {▪(RefLinkPlain[Date & Time, paclet:guide/DateAndTime])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/46-writing-good-code.html])(WebLink[: Writing Good Code, https://www.wolfram.com/language/elementary-introduction/46-writing-good-code.html])}})}})