Next: Operating System Processes Up: Time Previous: Machine Time

## Timing Execution

The `time-apply` procedure collects timing information for a procedure application:

- `(time-apply proc arg-list)` invokes the procedure proc with the arguments in arg-list. Four values are returned: a list containing the result(s) of applying thunk, the number of milliseconds of CPU time required to obtain this result, the number of ``real'' milliseconds required for the result, and the number of milliseconds of CPU time (included in the second result) spent on garbage collection.

The reliability of the timing numbers depends on the operating system. If multiple MzScheme threads are running, then the reported time may include work performed by other threads.

The `time` syntactic form reports timing information directly to the current output port:

- `(time expr)` times the evaluation of expr, printing timing information to the current output port. The result of the `time` expression is the result of expr.