Untitled

 avatar
unknown
plain_text
12 days ago
1.1 kB
3
Indexable
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

void function1() {
        for (int i = 0; i < 20000000; i++)
                cout << "+";
}

void function2() {
        for (int i = 0; i < 20000000; i++)
                cout << "-";
}

int main() {
        time_t start, end;
            time(&start);
                ios_base::sync_with_stdio(false);
                    
                        function1();
                            function2();
                                
                                    time(&end);
                                        
                                            double time_taken = double(end - start);
                                                cout << "Time taken by program is : " << fixed 
                                                         << time_taken << setprecision(20);
                                                             cout << " sec " << endl;
                                                                 
                                                                     return 0;
}
}
}
}
Editor is loading...
Leave a Comment