473,325 Members | 2,308 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,325 software developers and data experts.

Running time calculation

SSG
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...........

can anyone knows help me........

also tell me the definitions for system time, user time, real
time..........

Nov 15 '05 #1
3 9279
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
Nov 15 '05 #2

"SSG" <ss****@gmail.com> wrote

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...........

Firstly reduce the big O running time of your algorithm to the minimum.

Secondly cut out as many layers of "gift-wrapping" as possible. This
includes reformatting of data and layers of indirection on top of system
calls.

Thirdly look at reducing your requirements. If you are calculating the price
of an average supermarket shop, for instance, then taking a hundred baskets
and averaging them will give you a result almost as good as trawling through
every customer for the past year.

Finally try micro-optimisation of your inner loops. For instnace you cna
rewrite in assembly to improve cache coherence.
Nov 15 '05 #3
In article <da**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com>,
Malcolm <re*******@btinternet.com> wrote:

For instance you can rewrite in assembly to improve cache coherence.


That doesn't follow. Cache coherence is a property of the
patterns and timing of accessing objects in memory and their
mapping/unmapping from the cache. The issues involved in
tuning an algorithm to be cache-friendly apply equally whether
expressed in C or in assembly. At the very least, it's
probably a good idea to express the cache-friendly algorithm
in C first, see if it makes a difference, then go on to
assembly to extract other gains if possible.
--
7842++
Nov 15 '05 #4

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

Similar topics

5
by: Tom | last post by:
A field in a data set I want to import into Access is in Unix time (seconds from a certain time on a certain date). Does anyone know the precise date and the precise time on that date that Unix is...
12
by: Bill Nguyen | last post by:
What's the VB syntax to run the CR report using the following SP? I use CrystalreportViewer and ReportDocument. Thanks Bill Here's the SP in SQLserver 2K: CREATE proc mysp_ReportSubmission...
5
by: cvisal | last post by:
Hi all Im working on productivity calculations (Time calculations) and need some help in coding. Database Tool:MS-Access 2003. The general operator punch-in time is 5:30 AM and the punch-out...
1
by: sgmarty | last post by:
Hi, I have an interesting problem. Without using reduncant data, how can I design a calculation field to get a running total from values in different records? I'm designing a usage/month report, and...
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
1
by: Colin Clark | last post by:
Hello, I have a database of scores for a sports club. I want to display a continuous subform showing a person's scores for the season along with a running calculation based on those scores (the...
1
by: juliacjy | last post by:
Dear all, I'm needing an urgent help. I'm now maintaining a system which has a function of "Automatic Calculation". User is allowed to set of a time which then will be stored in one of my sql...
6
by: Lara1 | last post by:
I'm trying to get certain cells to show a hovering alert message when I click on them. (I don't want an error-message style box to pop up, because I'll eventually want it to show for lots of cells...
10
by: salzan | last post by:
I built a query and use it in a report. The query has one parameter that must be satified at run time which is . Rather than user type a value, I need to provide a value based on certain...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.