Advertisement
VisualPaul

vector::size speed test

Mar 2nd, 2013
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <vector>
  3.  
  4.  
  5. int main()
  6. {      
  7.         std::vector<char> v(100);
  8.         int res = 0;
  9.         for (int i = 0; i < 100000000; ++i)
  10.                 res += v.size();
  11.         printf("%d\n", res);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement