#include <iostream>
using namespace std;
int main()
{
int a=0;
for(a; a < 10000000000; a = a + 1 )
{
}
cout << "value of a: " << a << endl;
return 0;
}
Basic performance program.
If it takes longer than 5 seconds to complete, your machine is under-performing by today standards.
I'm not running that shit
>using namespace std;
L O L
O
L
>>58654986
Bet the loop will be optimized away anyway.
>>58655984
this
shit program, OP
>>58655984
not if you disable optimalizations
>>58654986
Shit that fits entirely in the L0 cache is not a good benchmark by any means. It's a nice wake-up call for programmers though, as even such trivial shit can take so much time.
>>58654986
>int
>10000000000
OK
>>58654986
it's been a few minutes and it has not completed
Is this what computer code looks like? I thought it was 0s and 1s?
>>58656073
explain?
>>58656147
that's at the very bottom of the totem pole. programming today uses layers of interpreters, so it has ideally a degree of readability.
>>58656215
This program is too small - it will never invoke reads from RAM. When program becomes too big to fit entirely in the CPU cache(99% of your software) it can become magnitudes slower.
>>58655984
maybe if the variable was declared within the for loop, but since its external, I doubt it would.
>>58656413
thanks