Please use code tags when posting code (didn’t you get a warning?)
➜ do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).
Depending on board type the max array size is pretty limited. So depending on the number of samples per second, the recording time will be limited. You might consider a SD card if you want to monitor longer periods.