writes to file the times