when you say bacon++ do you mean editing the code to put bacon++ in this way?
1 2 3 4 5 6 7 8 9 10 11 12
|
int main()
{
int bacon = 0;
while(bacon <=1000000)
{
cout << bacon << endl;
bacon++;
}
return 0;
}
|
if so, thanks a lot for the bacon++ tip guys :) but It's still slow by 30 seconds :( ( improved however from 40 seconds).
I understand that python is an interpreted language unlike c++.Thats why I'm really confused to see that its moving slower than it does in python.
@ stewbond
Both programs are being ran in a console. If anything running in console would improve the speed, not make it slower right?
True you can only see 100 lines of code.
How do you take the jump from "you cant see more than 100 lines in a console" therefore the test isn't practical? surely, c++ should be outperforming python in anything it do as it is a lower level language than python.
edit: its like saying assembly is slower in processing in some cases but when writing to a text file, it "should" be faster than c++. right? When in fact, assembly should be kicking c++'s butt in every single application.
but nevertheless, im interested! I know how to write to a file but I don't know how to record the time it takes for it complete :( .. Which is why I did a simple test like this, because the same process is happening in both consoles