I run through millions of records and sometimes I have to debug using Console.WriteLine to see what is going on.
However, Console.WriteLine is very slow, considerably slower than writing to a file.
BUT it is very convenient – does anyone know of a way to speed it up?
You can use the
OutputDebugStringAPI function to send a string to the debugger. It doesn’t wait for anything to redraw and this is probably the fastest thing you can get without digging into the low-level stuff too much.The text you give to this function will go into Visual Studio Output window.
[DllImport("kernel32.dll")] static extern void OutputDebugString(string lpOutputString);Then you just call
OutputDebugString("Hello world!");