Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. template< class StackType >
  2. void test( char const* const description )
  3. {
  4. for( int it = 0; it < 4; ++it )
  5. {
  6. StackType st;
  7.  
  8. HighResolutionTimer timer;
  9.  
  10. timer.Start();
  11.  
  12. for( Index i = 0; i < 1000000000; ++i )
  13. {
  14. st.push( i );
  15. if( i % 1000 == 0 && i != 0 )
  16. {
  17. for( int j = 0; j < 1000; ++j ) { st.pop(); }
  18. }
  19. }
  20.  
  21. double const totalTime = timer.Stop();
  22. wcout << description << ": " << totalTime << endl;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement