MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / Output

Function Output

DbgMsgSrc/DbgMsgSrc.cpp:178–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178void 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
213void EndlessTest()
214{

Callers 1

MainFunction · 0.85

Calls 3

getMilliCountFunction · 0.85
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected