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

Dynamically estimating time needed to complete a program

I have a while loop in my program that is going to execute a very large
number of loops (well over 100000000). Sometimes this can take quite
some time for the computer to process so I'd like the program to supply
some sort of estimate as to how long the process may take. The number
of times the program must loop as well as the amount of proccessing
required for the block of code in the loop is entirely dependant on
choices the user makes before the processing begins so I can't just
print out a generic estimate. I'm not sure how to approach something
like this, is there a way for the computer to estimate using the time
it takes to complete a small number of loops (say 1000 or so)?

Aug 22 '05 #1
1 1538
Starx wrote:
I have a while loop in my program that is going to execute a very large
number of loops (well over 100000000). Sometimes this can take quite
some time for the computer to process so I'd like the program to supply
some sort of estimate as to how long the process may take. The number
of times the program must loop as well as the amount of proccessing
required for the block of code in the loop is entirely dependant on
choices the user makes before the processing begins so I can't just
print out a generic estimate. I'm not sure how to approach something
like this, is there a way for the computer to estimate using the time
it takes to complete a small number of loops (say 1000 or so)?


That's the way I'd do it. IOW, perform the first K loops (K < N), get the
clock readings (wall clock as well as CPU clock) and then print out the
estimate by extrapolating (multiplying by 'double(N)/K').

Also, it might be useful to indicate the progress somehow. If your app
does not have a user interface (interaction), you might want to create
a file named something like (progress_NN_percent) in the current (working)
directory, or have a periodic output to the log file (you do have a log
file, don't you?)

V
Aug 22 '05 #2

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

Similar topics

2
by: sympatico | last post by:
I am looking for a good document of spread sheet that can help me better estimate the amount of time and money a software development project should take. I am using .NET Framework I have been...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
1
by: engwar | last post by:
Not really sure how to ask this. I'm new to CSS/DHTML I want to create something similar to how yahoo and gmail handle the "to" field when you type an email. If you start typing "d" you will...
12
by: Wardeaux | last post by:
All, Wanting to find a way to create web pages to add to my website without having to recompile the codebehind everytime I want to add a new one... Here's the deal: I have a web app that takes...
48
by: Michel Rouzic | last post by:
I know it must sound like a newbie question, but I never really had to bother with that before, and I didn't even find an answer in the c.l.c FAQ I'd like to know what's the really proper way...
7
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
94
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
0
by: uncensored | last post by:
Hi, Sort of new with the whole treeview control and I was wondering is there a way to build a treeview menu using my SQL data I pull from a database instead of having to hard code it into the...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.