Here is the updated version, it should not crash anymore, even if the plugin doesn't have full write access to the output file...
Added another line to the output file (last line): milliseconds 8)
Let me know if this one works better with your script...