Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- #include <iostream>
- #include <ctime>
- using namespace std;;
- int main() {
- vector <int> v;
- const int BIG = 10000000;
- for ( int i = 0; i < BIG; i++ ) {
- v.push_back( i );
- }
- cout << "beginn";
- int n = 0;
- time_t now = time(0);
- for ( int a = 0; a < 10; a++ ) {
- for( vector <int>::iterator it = v.begin(); it != v.end(); ++it ) {
- n += *it;
- }
- }
- cout << time(0) - now << "n";
- now = time(0);
- for ( int a = 0; a < 10; a++ ) {
- for( vector <int>::const_iterator cit = v.begin(); cit != v.end(); ++cit ) {
- n += *cit;
- }
- }
- cout << time(0) - now << "n";;
- return n != 0;
- }
- call clock_gettime
- movl 56(%esp), %esi
- movl $10, %ecx
- movl 60(%esp), %edx
- .p2align 4,,7
- .p2align 3
- .L35:
- cmpl %esi, %edx
- je .L33
- movl %esi, %eax .p2align 4,,7
- .p2align 3
- .L34:
- addl (%eax), %ebx
- addl $4, %eax
- cmpl %eax, %edx
- jne .L34
- .L33:
- subl $1, %ecx
- jne .L35
- leal 68(%esp), %edx
- movl %edx, 4(%esp)
- leal 56(%esp), %esi
- movl $1, (%esp)
- movl 60(%esp), %edx
- movl $10, %ecx
- movl 56(%esp), %esi
- .p2align 4,,7
- .p2align 3
- .L38:
- cmpl %esi, %edx
- je .L36
- movl %esi, %eax
- .p2align 4,,7
- .p2align 3
- .L37:
- addl (%eax), %ebx
- addl $4, %eax
- cmpl %eax, %edx
- jne .L37
- .L36:
- subl $1, %ecx
- jne .L38
- leal 68(%esp), %edx
- movl %edx, 4(%esp)
- leal 56(%esp), %esi
- movl $1, (%esp)
Add Comment
Please, Sign In to add comment