473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Program Running Time

# time ./a.out test.data

the output:

real 0m49.172s
user 0m5.638s
sys 0m4.850s

Why real time and user time have big difference? I've tried to change
a code: for example disable print() function, the real time and user
time closer. How to improve the real time in a program?
Jan 15 '08 #1
3 2139
In article <f7db0716-0e06-4caa-95fc-284130408b44
@l32g2000hse.googlegroups.com>, cp***************@gmail.com says...
# time ./a.out test.data

the output:

real 0m49.172s
user 0m5.638s
sys 0m4.850s

Why real time and user time have big difference? I've tried to change
a code: for example disable print() function, the real time and user
time closer. How to improve the real time in a program?
This basically means your program is I/O bound. Without knowing more
about how that's occurring it's impossible to suggest improvements.
Sometimes, it's just the nature of that particular program (e.g. cat
will almost always be heavily I/O bound).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jan 15 '08 #2
On Jan 14, 6:18 pm, cplusplusquest...@gmail.com wrote:
# time ./a.out test.data

the output:

real 0m49.172s
user 0m5.638s
sys 0m4.850s

Why real time and user time have big difference? I've tried to change
a code: for example disable print() function, the real time and user
time closer. How to improve the real time in a program?
http://www.google.com/search?hl=en&q...=Google+Search

The first result would probably be a good place to start.

I wouldn't do anything without a profiler though.
Jan 15 '08 #3
On Jan 15, 1:44 pm, jonnyot...@gmail.com wrote:
On Jan 14, 6:18 pm, cplusplusquest...@gmail.com wrote:
# time ./a.out test.data
the output:
real 0m49.172s
user 0m5.638s
sys 0m4.850s
Why real time and user time have big difference? I've tried to change
a code: for example disable print() function, the real time and user
time closer. How to improve the real time in a program?

http://www.google.com/search?hl=en&q...2B%2B+code&btn...

The first result would probably be a good place to start.

I wouldn't do anything without a profiler though.
Thanks. It's really helpful.
Jan 15 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
17
by: los | last post by:
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to...
22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
3
by: John Cho | last post by:
/* This program is a database program that will store video tape names, minutes, year released, and price I want it to be professional so that *YOU* will want to buy it and use it for a video...
5
by: chellappa | last post by:
hi, i want to find the ruuning time of program using c .. problem: i want to find the running time of program using c , i have one routine in c,,, i want to find how much , its take for...
2
by: UJ | last post by:
I am writing an automatic download process that will update software on a computer. We've got services that run all of the time and a couple of programs that run all of the time. How can I tell if...
17
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
14
by: fdu.xiaojf | last post by:
Hi, I have a program which will continue to run for several days. When it is running, I can't do anything except waiting because it takes over most of the CUP time. Is it possible that the...
6
by: dspfun | last post by:
I would like to analyze my running c-program. What I would like to know for example is the range of the entire address space of my running c-program (memory reserved for/by the running program),...
2
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.