NAME

rusage() - reports information gathered by the UNIX(tm) getrusage() system call

SYNOPSIS

mapping rusage();

DESCRIPTION

This efun collects information gathered via the UNIX(tm) getrusage() system call. Read the getrusage() man page for more information on what information will be collected. Some systems do not have the getrusage() system call but do have the times() system call. On those systems, only "usertime" and "stime" will be available (in units of clock ticks which are system dependent). If getrusage() is available, times will be reported in milliseconds.

Here is an example usage of rusage():

  void
  create()
  {
      mapping info;

      info = rusage();
      write("user time = " + info["usertime"] + "ms\n");
      write("system time = " + info["stime"] + "ms\n");
  }
The available fields are:

usertime, stime, maxrss, ixrss, idrss, isrss, minflt, majflt, nswap, inblock, oublock, msgsnd, msgrcv, nsignals, nvcsw, nivcsw.

SEE ALSO

query_load_average(3)