News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Execution times are extremely slow, how to fix?

Started by Sliverious, June 28, 2016, 04:28:00 PM

Previous topic - Next topic

Sliverious

I just started with C::B and C++, so I am unsure what is causing this to happen. I DL'ed 16.01+minGW today, and got it to work by resetting to default. The sad thing is, it's absurdly slow (see image).
How do I fix this?

Another problem I'm having is that build&run always yields the same rand(), of which I'm unsure what program to blame.



raynebc

Running a program in a debugger introduces a fair amount of overhead and delay.  As for your issue with rand(), it's because you're not seeding it with a unique value (ie. the system time is a very commonly used value because it will generally be different from one use of a program to the next in any normal circumstances).  By design, a pseudo-random number algorithm must produce the same sequence of numbers any time it is used with the same initial value (seed).

oBFusCATed

Quote from: raynebc on June 28, 2016, 07:21:17 PM
Running a program in a debugger introduces a fair amount of overhead and delay.
He is not running his program in debug, but this time includes the overhead of starting the executable. Probably he has a A/V software that slows things down.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]