#include <iostream>#include <vector>#include <cstdlib>#include <QVector>int main(int argc, char *argv[]){ time_t t1, t2; std::time (&t1); for (int i = 0; i < 10000; ++i) { std::vector<int> stdList; for (int i = 0; i < 100000; i++) stdList.push_back(i); } std::time (&t2); std::cout << "STD: " << t2 - t1 << '\n'; std::time (&t1); for (int i = 0; i < 10000; ++i) { QVector<int> qtList; for (int i = 0; i < 100000; i++) qtList.append(i); } std::time (&t2); std::cout << "Qt: " << t2 - t1 << '\n';}
std::list QListappend: 2100 330prepend: 2100 450insert: 47 8700
std::list QLinkedListappend: 2100 1970prepend: 2100 2000insert: 2100 2100
std::vector QVectorappend: 235 330prepend: - 8700insert: - 8700
std::map QMapadd new item: 750 550