rusage

UNIX Programming. struct timeval how to print it (C-programming)

I am trying to print a value of type timeval. Actually I am able to print it, but I get the following warning: Multiple markers at this line format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘struct timeval’ The program compiles and it prints the values, but I would like to know if I am doing something wrong. Thanks. ...

getrusage() get system time, user time. Unix programming help

I am writing a shell where I need to launch several child processes at once and record the system time and user time. So far I am able to do it. The only problem is that I am using wait4 to grab the system resources used by the child program and put it in my rusage structure called usage. How can I launch all the processes at the same ...

rusage() measured in seconds or millseconds?

Hi I'm trying to get the system time and user time of applications being forked by a shell. I'm just not sure what kind of time I'm getting, seconds? milliseconds? Does anybody know? printf("System time: %ld.%06ld sec\n",usage.ru_stime.tv_sec, usage.ru_stime.tv_usec); printf("User time: %ld.%06ld sec\n\n",usage.ru_utime.tv_sec, usage...