|
Prev: Initial an Array
Next: equation to C++
From: cplusplusquestion on 14 Jan 2008 18:25 When I run the program: # time ./a.out test.data the output: real 0m49.172s user 0m5.638s sys 0m4.850s Why real time and user time are big difference? How to reduce Real Time?
From: Francis Glassborow on 14 Jan 2008 18:51 cplusplusquestion(a)gmail.com wrote: > When I run the program: > > # time ./a.out test.data > > the output: > > real 0m49.172s > user 0m5.638s > sys 0m4.850s > > Why real time and user time are big difference? How to reduce Real > Time? at a wild guess, because your machine was multi-tasking :)
From: cplusplusquestion on 14 Jan 2008 19:53 On Jan 15, 9:51 am, Francis Glassborow <francis.glassbo...(a)btinternet.com> wrote: > cplusplusquest...(a)gmail.com wrote: > > When I run the program: > > > # time ./a.out test.data > > > the output: > > > real 0m49.172s > > user 0m5.638s > > sys 0m4.850s > > > Why real time and user time are big difference? How to reduce Real > > Time? > > at a wild guess, because your machine was multi-tasking :) I didn't run another jobs, I pretty sure, because when I change the code, the result is different.
From: James Dennett on 14 Jan 2008 23:30 cplusplusquestion(a)gmail.com wrote: > On Jan 15, 9:51 am, Francis Glassborow > <francis.glassbo...(a)btinternet.com> wrote: >> cplusplusquest...(a)gmail.com wrote: >>> When I run the program: >>> # time ./a.out test.data >>> the output: >>> real 0m49.172s >>> user 0m5.638s >>> sys 0m4.850s >>> Why real time and user time are big difference? How to reduce Real >>> Time? >> at a wild guess, because your machine was multi-tasking :) > > I didn't run another jobs, I pretty sure, because when I change the > code, the result is different. The CPU time used for running your program was about 10 seconds. The rest of the time, the system was busy doing other things. It is possible that it was spending its time waiting for the disk. This isn't a C or C++ language issue, so it's rather off-topic here. -- James
|
Pages: 1 Prev: Initial an Array Next: equation to C++ |