How to write data in chunks to SD card to improve Sampling Rate? [SOLVED!]

The Nil RTOS example is a working app. You don't need to program it for your use.

Just select the number of analog pins and rate. For one or two analog pins you can record at up to 1000 Hz.

The jitter in time between samples will be much better than a loop with a delay call. This could be important depending on what data analysis is required.