473,395 Members | 1,823 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,395 software developers and data experts.

running time

I implemented a neighborhood search algorithm using C++ and STL. A
strange thing is that the first 1000 iterations use 0.01 min., but the
next 1000 iterations use 0.02 min. and the next 1000 iterations also use
0.02 min. Every iteration does exactly the same thing, and I don't
understand how come the first 1000 iterations use less time than the
rest. I hope you guys can help me out.

Sin
Jul 22 '05 #1
3 1433
Sin C. Ho wrote:
I implemented a neighborhood search algorithm using C++ and STL. A
strange thing is that the first 1000 iterations use 0.01 min., but the
next 1000 iterations use 0.02 min. and the next 1000 iterations also use
0.02 min. Every iteration does exactly the same thing, and I don't
understand how come the first 1000 iterations use less time than the
rest. I hope you guys can help me out.


Increase the number of iterations to one million to get better resolution.

V
Jul 22 '05 #2
Victor Bazarov wrote:
Sin C. Ho wrote:
I implemented a neighborhood search algorithm using C++ and STL. A
strange thing is that the first 1000 iterations use 0.01 min., but the
next 1000 iterations use 0.02 min. and the next 1000 iterations also
use 0.02 min. Every iteration does exactly the same thing, and I don't
understand how come the first 1000 iterations use less time than the
rest. I hope you guys can help me out.

Increase the number of iterations to one million to get better resolution.

V

Actually, I set the total number of iterations to 100,000. The first
1000 iterations require less time than the next 1000 iterations'.

Sin
Jul 22 '05 #3
Sin C. Ho wrote:
Victor Bazarov wrote:
Sin C. Ho wrote:
I implemented a neighborhood search algorithm using C++ and STL. A
strange thing is that the first 1000 iterations use 0.01 min., but
the next 1000 iterations use 0.02 min. and the next 1000 iterations
also use 0.02 min. Every iteration does exactly the same thing, and I
don't understand how come the first 1000 iterations use less time
than the rest. I hope you guys can help me out.


Increase the number of iterations to one million to get better
resolution.

V


Actually, I set the total number of iterations to 100,000. The first
1000 iterations require less time than the next 1000 iterations'.


How sure are you about that? What's your way of timing your one thousand
iterations (whether first or next)? What if you time 900 or 1200, how
much different will the reading be?
Jul 22 '05 #4

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

Similar topics

3
by: Edg Bamyasi | last post by:
This Is A Late Cross Post from comp.lang.python. It seems the mistery is deeper then i expected. What is the running time of conactination on character strings. i.e. >> joe="123" >>...
8
by: nickdu | last post by:
I'm trying to isolate "applications" into their own application domain within a single process. I've quoted applications because it's a logical representation of an application. Basically it...
4
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
3
by: SSG | last post by:
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...
4
by: Rajeev | last post by:
I want to calculate the running time of my program, which runs for a long time(~ a day). This is what I am doing in my code: #include <time.h> clock_t tend, tstart; tstart = clock(); \*...
0
by: Rajeev | last post by:
I want to calculate the running time of my program, which runs for a long time(~ a day). This is what I am doing in my code: #include <time.h> clock_t tend, tstart; tstart = clock(); \*...
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...
20
by: upperclass | last post by:
Hi, I'm trying to find a decent way of measuring the running time of a long-running program. Say, the running time ranges from several seconds to more than a day. The standard clock()...
2
by: upperclass | last post by:
Hi, I'm trying to find a decent way to measure program running time. I know clock() is probably the standard way of doing it but clock_t overflows too quickly. The target program running time...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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
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...

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.