Changeset 87c5f40 for doc/generic_types/evaluation/cpp-bench.cpp
- Timestamp:
- Apr 11, 2017, 5:11:55 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4f57930
- Parents:
- e6dceef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/cpp-bench.cpp
re6dceef r87c5f40 1 #include <algorithm> 1 2 #include <stdlib.h> 3 #include <utility> 2 4 #include "bench.hpp" 3 5 #include "cpp-stack.hpp" … … 20 22 ) 21 23 22 int sum;24 int max = 0; 23 25 REPEAT_TIMED( "pop_int", 24 sum += t.pop(); 26 max = std::max( max, t.pop() ); 27 ) 28 29 stack<std::pair<bool, char>> s2; 30 REPEAT_TIMED( "push_bool_char", 31 s2.push( std::pair<bool, char>{ rand() & 0x1, rand() & 0x7F } ); 32 ) 33 34 stack<std::pair<bool,char>> t2; 35 TIMED( "copy_bool_char", 36 t2 = s2; 37 ) 38 39 TIMED( "clear_bool_char", 40 s2.clear(); 41 ) 42 43 std::pair<bool, char> max2 = { false, '\0' }; 44 REPEAT_TIMED( "pop_bool_char", 45 max2 = std::max( max2, t2.pop() ); 25 46 ) 26 47 }
Note: See TracChangeset
for help on using the changeset viewer.