TimeUsed[]
gives the total number of seconds of CPU time used so far in the current Wolfram System session.
TimeUsed
TimeUsed[]
gives the total number of seconds of CPU time used so far in the current Wolfram System session.
Details
Examples
open all close allBasic Examples (2)
CPU time used by a Wolfram Language kernel:
TimeUsed[]Get time between function evaluations:
{res, {times}} = Reap[Sqrt[2] - x /. FindRoot[x ^ 2 - 2, {x, 1.}, WorkingPrecision -> 1000000, EvaluationMonitor :> Sow[TimeUsed[]]]]Almost all of the time is spent in the last few evaluations because the precision is adaptive:
ListPlot[{times - times[[1]], Join[{0}, Differences[times]]}, PlotRange -> All]Scope (1)
Get time used by function evaluations and the rest of a computation:
f[a_ ? NumberQ] := Module[{x, t, r}, Sow[TimeUsed[]];r = First[x[1] /. NDSolve[{x''[t] + (a / 1000 + Exp[-1000 t ^ 2]) == Sin[a t], x[-1] == 0, x'[-1] == 0}, x, {t, -1, 1}, Method -> "StiffnessSwitching", WorkingPrecision -> 32, MaxSteps -> Infinity]];Sow[TimeUsed[]];r]Short[{res, {times}} = Reap[Quiet[FindRoot[f[a], {a, 1000}, WorkingPrecision -> 32]]], 16]times[[-1]] - times[[1]]evals = Apply[(#2 - #1)&, Partition[times, 2], {1}];
{Total[evals], Mean[evals]}Evaluations tended to be faster near the root:
ListPlot[evals]See Also
Timing SessionTime DateList DateString AbsoluteTime $CloudCreditsAvailable
Function Repository: TimeMemoryUsed
Tech Notes
Related Guides
History
Introduced in 1991 (2.0)
Text
Wolfram Research (1991), TimeUsed, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeUsed.html.
CMS
Wolfram Language. 1991. "TimeUsed." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TimeUsed.html.
APA
Wolfram Language. (1991). TimeUsed. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeUsed.html
BibTeX
@misc{reference.wolfram_2026_timeused, author="Wolfram Research", title="{TimeUsed}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/TimeUsed.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_timeused, organization={Wolfram Research}, title={TimeUsed}, year={1991}, url={https://reference.wolfram.com/language/ref/TimeUsed.html}, note=[Accessed: 13-June-2026]}