Mathematica's symbolic timing framework allows timing information not only to be analyzed but also to be used in the structure of algorithms.
Mathematica provides functions to allow programmers to take advantage of the same kinds of powerful optimizations as
Mathematica's carefully tuned internal code.
TimeConstrained — run a command for at most a specified time
Timing — CPU time to run a command within the
Mathematica kernel
AbsoluteTiming — total wall-clock time to run a command
N — use approximate rather than exact numbers
Compile — compile a numeric function into byte or machine code
Dispatch — preprocess large lists of rules
Hash — find a numeric hash code for any expression