home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / unix.time < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.0 KB  |  40 lines

  1.     
  2.     _C_P_U _t_i_m_e _u_s_e_d
  3.     
  4.          unix.time(expr)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.             expr : Valid R expression to be ``timed''
  9.     
  10.     _D_e_s_c_r_i_p_t_i_o_n:
  11.     
  12.          unix.time calls the builtin proc.time, evaluates expr,
  13.          and the calls proc.time once more, returning the
  14.          difference to between the proc.time calls.
  15.     
  16.          The values returned by the proc.time are (currently)
  17.          those returned by the C library function times(3v).
  18.     
  19.     _V_a_l_u_e:
  20.     
  21.          A numeric vector of length 5 containing the cpu, user,
  22.          total, subproc1, subproc2 times.
  23.     
  24.     _S_e_e _A_l_s_o:
  25.     
  26.          proc.time, date, time which is for time-series.
  27.     
  28.     _E_x_a_m_p_l_e_s:
  29.     
  30.          unix.time(for(i in 1:50) mad(runif(500)))
  31.          exT <- function(n = 100)
  32.          {
  33.            ## Purpose: Test if unix.time works ok;   n: loop size
  34.            unix.time(for(i in 1:n) x <- mean(rt(1000, df=4)))
  35.          }
  36.          ##-- Try to interrupt one of the following (using Ctrl-C):
  37.          exT() #- '1.4' on -O-optimized Ultra1
  38.          unix.time(exT()) #~ +/- same
  39.     
  40.