> I am trying to benchmark a program and would like to know how to find the cpu
> time use by the program. I know about the c shell time command, but I am not
> very sure what is user time and system time. If I am not wrong, user time is
> the time the cpu does i/o and system time is the time instruction go into the
> processor. Can anyone confirm it ?
User time: CPU time spent on user functions (most will include some of above).
You can use calls like getrusage() or gettimeofday() to time functions, butQuote:> BTW can anyone tell me exactly what is meant by the cpu time seen in scientific
> journal? I like to know how the program we developed compared with other people
> Has anyone done anything like this before care to comment?
> p.s. I have two programs doing the same things (different algorithm) but one
> of them is a commerial program so I do not have the source code.
note that these are built with the exectable i.e. included in the source.
Without source you are limited to using the time command. Also, profiling
tools can be helpfull, again this is a compile time monitor. Try >man prof;
man 2 getrusage; man 2 gettimeofday.