Measuring about variable speed applications

 

Here is the code used for testing:

 1 #include <bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 int main(){
 6     cout<<"(Type)"<<endl;
 7     for(int i=1;i<=5e7;i++){
 8         (Type) a;
 9     }
10 }

 result:

int
-----------------------------------------
Runing Time:    104.599ms
-----------------------------------------
long long
-----------------------------------------
Runing Time:    104.540ms
-----------------------------------------
vector<int>
-----------------------------------------
Runing Time:   1749.897ms
-----------------------------------------
deque<int>
-----------------------------------------
Runing Time:  14822.420ms
-----------------------------------------
queue<int>
-----------------------------------------
Runing Time:  38413.759ms
-----------------------------------------
map<int,int>
-----------------------------------------
Runing Time:   1571.477ms
-----------------------------------------
set<int>
-----------------------------------------
Runing Time:   1570.402ms
-----------------------------------------
list<int>
-----------------------------------------
Runing Time:   1482.101ms
-----------------------------------------

 

Guess you like

Origin www.cnblogs.com/marmot-cage/p/11391168.html