[IPython-user] What is System time in timing report?

Fernando Perez fperez.net@gmail....
Sun Aug 17 04:04:06 CDT 2008


Hi Dick,

sorry for the delayed reply...

On Fri, Jul 25, 2008 at 7:59 AM, Dick Moores <rdm@rcblue.com> wrote:
> In [12]: run -t -N100 1s.py
>
> IPython CPU timings (estimated):
> Total runs performed: 100
>   Times :      Total       Per run
>   User  : 4.08950523041 s, 0.0408950523041 s.
>   System:        0.0 s,        0.0 s.
>
> What is "System"? And what kind of things in a script would raise
> System time above zero?

On a Unix OS, the kernel distiguishes between time spent by your
program making system calls and time running your own code.  So for
example if your script makes lots of large memory allocations, you may
see sufficient system time reported.  Windows doesn't report system
time separately, so under windows this is always zero.  IPython gets
this information via the getrusage call:




NAME
       getrusage - get resource usage

SYNOPSIS
       #include <sys/time.h>
       #include <sys/resource.h>

       int getrusage(int who, struct rusage *usage);

DESCRIPTION
       getrusage()  returns  current  resource  usages,  for  a  who  of  either
       RUSAGE_SELF or RUSAGE_CHILDREN.  The former asks for  resources  used  by
       the  calling process, the latter for resources used by those of its chil-
       dren that have terminated and have been waited for.

           struct rusage {
               struct timeval ru_utime; /* user time used */
               struct timeval ru_stime; /* system time used */
               long   ru_maxrss;        /* maximum resident set size */
               long   ru_ixrss;         /* integral shared memory size */
               long   ru_idrss;         /* integral unshared data size */
               long   ru_isrss;         /* integral unshared stack size */
               long   ru_minflt;        /* page reclaims */
               long   ru_majflt;        /* page faults */
               long   ru_nswap;         /* swaps */
               long   ru_inblock;       /* block input operations */
               long   ru_oublock;       /* block output operations */
               long   ru_msgsnd;        /* messages sent */
               long   ru_msgrcv;        /* messages received */
               long   ru_nsignals;      /* signals received */
               long   ru_nvcsw;         /* voluntary context switches */
               long   ru_nivcsw;        /* involuntary context switches */
           };


Cheers,

f


More information about the IPython-user mailing list