Running Time of S-PLUS

DESCRIPTION:

Returns a length 5 vector of cumulative times for the current S-PLUS session.

USAGE:

proc.time() 

VALUE:

numeric vector, giving the user, system and elapsed times for the currently running S-PLUS process, in units of seconds. If there have been any child processes spawned during the current session, the cumulative sums of the user and system times for them is also returned (Note: this applies to UNIX only, as Windows does not have child processes).

NOTE:

This function is likely to be most useful in recording checkpoints for computations; particular expressions can be timed by computing the difference between such checkpoints. The last two columns (elapsed times for child processes) will be blank in Windows.

SEE ALSO:

, , .

EXAMPLES:

 
now <- proc.time()[1:2] # checkpoint 
random <- runif(1000)   # or some other computation 
speed <- proc.time()[1:2] - now # time taken for computation
now <- proc.time() # checkpoint 
random <- runif(1000)   # or some other computation 
speed <- proc.time() - now # time taken for computation