Author Topic: Execution times are extremely slow, how to fix?  (Read 4941 times)

Sliverious

  • Guest
Execution times are extremely slow, how to fix?
« 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.



Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: Execution times are extremely slow, how to fix?
« Reply #1 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).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Execution times are extremely slow, how to fix?
« Reply #2 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.
(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!]