- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cpp-bench.cpp
r604e76d r79d4186 1 1 #include <algorithm> 2 #include <fstream>3 2 #include "bench.hpp" 4 3 #include "cpp-stack.hpp" 5 4 #include "cpp-pair.hpp" 6 #include "cpp-print.hpp"7 5 8 6 int main(int argc, char** argv) { 9 std::ofstream out{"/dev/null"};10 7 int maxi = 0, vali = 42; 11 8 stack<int> si, ti; … … 15 12 TIMED( "clear_int", si.clear(); ) 16 13 REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop() ); ) 17 REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); )18 14 19 15 pair<bool, char> maxp = { false, '\0' }, valp = { true, 'a' }; … … 24 20 TIMED( "clear_pair", sp.clear(); ) 25 21 REPEAT_TIMED( "pop_pair", N, maxp = std::max( maxp, tp.pop() ); ) 26 REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); )27 22 }
Note:
See TracChangeset
for help on using the changeset viewer.