Code::Blocks Forums

User forums => Help => Topic started by: Sliverious on June 28, 2016, 04:28:00 pm

Title: Execution times are extremely slow, how to fix?
Post by: Sliverious on June 28, 2016, 04:28:00 pm
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.


(http://i.imgur.com/labloFC.png)
Title: Re: Execution times are extremely slow, how to fix?
Post by: raynebc on June 28, 2016, 07:21:17 pm
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).
Title: Re: Execution times are extremely slow, how to fix?
Post by: oBFusCATed on June 29, 2016, 02:04:41 am
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.