I am trying to use ISR to write a float to the SD card at 120 Hz (8.3ms), and then writing a char array every 4 seconds. My question is, what is the execution time of opening the file, writing, and closing the file? My other option is to collect more data before writing, but due to memory constraints I was hoping to find the answer to this first.
Also as I understand, writing to SD card, using SD Fat Library, actually writes to a buffer. And then the buffer is committed to memory. If I am correct about that process, what is the execution time of that commit process when the buffer is full?
Yes, at least the magnitude of the time for regular File.print(), as well as the time it takes to write the block. If it is large enough I need to adjust the frequency of my interrupts. Are we talking nanoseconds, milliseconds, microseconds?
All of your questions can be answered by yourself by using millis() to compute the elapsed time for each of your functions.
As for time to write to the SD card, that depends entirely on the SD card. They are not blank sheets of paper. They have their own electronics to handle your requests. Yes, they are just like the old floppy disks. They read and write in blocks of 512 bytes. You will likely get more information for other forum members.
I believe closing the file will flush everything, so it will add a lot of time to the process if you close the file after every write. So you might consider closing the file only at the end of the entire process. The library should accumulate your writes, and write them to the SD card in 512-byte blocks. There's no benefit from doing any buffering of your own in addition to that so long as you're not prematurely closing the file.
Writing speed will also be affected by whether the card has been pre-erased. You can erase and format a card with the SDFormatter.ino example in SDFat.