| 40 | |
| 41 | template <typename T, void F(T&, ReadBuffer&)> |
| 42 | void NO_INLINE loop(ReadBuffer & in, WriteBuffer & out) |
| 43 | { |
| 44 | T sum = 0; |
| 45 | T x = 0; |
| 46 | |
| 47 | Stopwatch watch; |
| 48 | |
| 49 | while (!in.eof()) |
| 50 | { |
| 51 | F(x, in); |
| 52 | in.ignore(); |
| 53 | sum += x; |
| 54 | } |
| 55 | |
| 56 | watch.stop(); |
| 57 | out << "Read in " << watch.elapsedSeconds() << " sec, " |
| 58 | << formatReadableSizeWithBinarySuffix(in.count() / watch.elapsedSeconds()) << "/sec, result = " << sum << "\n"; |
| 59 | } |
| 60 | |
| 61 | |
| 62 | int main(int argc, char ** argv) |
no test coverage detected