File I/O is usually one of the slowest operations on a computer. Make sure that you are not opening and closing the file inside of the while loop. It sounds like you are using the Write Characters to File VI, which is a high-level VI that opens and closes the file automatically.
A more efficient way of doing this is to open the file outside of the loop using the Open File VI, use the Write File VI inside of the loop, and Close File outside of the loop. Also, a binary file will be more efficient than writing an ASCII file. Writing a file still takes time, but it will be greatly more efficient doing it this way.
Allen P.
National Instruments