| 176 | } |
| 177 | |
| 178 | void Output(const std::string& filename) |
| 179 | { |
| 180 | std::fstream fs; |
| 181 | fs.open(filename, std::fstream::in); |
| 182 | |
| 183 | if (!fs) |
| 184 | { |
| 185 | std::cout << "\"" << filename << "\" not found!\n"; |
| 186 | return; |
| 187 | } |
| 188 | |
| 189 | std::cout << "Reading " << filename << "...\n"; |
| 190 | std::vector<std::string> lines; |
| 191 | std::string line; |
| 192 | while (getline(fs, line)) |
| 193 | lines.push_back(line); |
| 194 | fs.close(); |
| 195 | |
| 196 | std::cout << "writing... " << lines.size() << " lines\n"; |
| 197 | |
| 198 | int i = 0; |
| 199 | long t1 = getMilliCount(); |
| 200 | |
| 201 | for (auto s = lines.begin(); s != lines.end(); ++s) |
| 202 | { |
| 203 | ++i; |
| 204 | //auto t = s + "\n"; |
| 205 | OutputDebugStringA(s->c_str()); |
| 206 | //Sleep(50); |
| 207 | } |
| 208 | long t2 = getMilliCount(); |
| 209 | |
| 210 | std::cout << "OutputDebugStringA " << i << " lines, took: " << t2 - t1 << " ms\n"; |
| 211 | } |
| 212 | |
| 213 | void EndlessTest() |
| 214 | { |
no test coverage detected