Skip to content

Commit f7310da

Browse files
Re-add fflush() after each CSV row when --output_stdout
This was accidentally removed 2.0.0, causing data lag issues for tools using PresentMon console application with stdout output. See issue #232
1 parent 356b2d1 commit f7310da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

PresentMon/CsvOutput.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ void WriteCsvHeader<FrameMetrics1>(FILE* fp)
148148
fwprintf(fp, L",QPCTime");
149149
}
150150
fwprintf(fp, L"\n");
151+
152+
if (args.mCSVOutput == CSVOutput::Stdout) {
153+
fflush(fp);
154+
}
151155
}
152156

153157
template<>
@@ -213,6 +217,9 @@ void WriteCsvRow<FrameMetrics1>(
213217
}
214218
fwprintf(fp, L"\n");
215219

220+
if (args.mCSVOutput == CSVOutput::Stdout) {
221+
fflush(fp);
222+
}
216223
}
217224

218225
template<>

0 commit comments

Comments
 (0)