On Thu, 07 Jul 2005 00:15:39 -0700, SSG wrote:
Hi All!
I know how to calculate the running time of a particular routine, but i
want to know how to reduce the running time in a program...........
This is a very large topic. You usually start however by analysing the
overall problem and selecting good algorithms. Algorithm selection can
have an enormously greater effect than micro-optimisations you might apply
later on.
can anyone knows help me........
also tell me the definitions for system time, user time, real
time..........
These definitions don't really exist in C. You may have monitoring tools
that use these terms. A common definiion is that system time is the CPU
time spent executing in the OS/system/kernel, user time is the time spent
executing (non-system) application code and real time is the elapsed
"wall-clock" time of the execution.
In C the time() function can be used to give a measurement of real time,
and the clock() function of CPU time. the meaning of "CPU time" here is
implementation specific but it typically a combination of system and user
time, it could even correspond to real time especially on a
non-multitasking system.
Lawrence