I am much better with visual aides.
If I read your code correctly, you are collecting data and piling it all up in memory. After you app has used up all the available memory, it will start using virtual memory. This will continue (slowing down as it goes) until you have exausted even the virtual memory. If the operating system is nice it may tell you this, otherwise the app will crash, probably with a memory violation.
If you really want to collect data at 5MS/s, then you you are going to need alot of memory to buffer all of your data.
Next, on every pass of your loop, you are proccessing more and more data. The more work that needs done, the longer it will take.
One more thing, using the build array function inside a loop will cause LV and the operat
ing system to allocate more memory everytime you try to add more data to a buffer than is already allocated. When these allocations take place LV tries to double the size of the buffer (my opinion only based on observations). This situation is generally avoided by initializing a buffer before entering the loop that is more than big enough to store what you will be collecting. Then inside the loop, use a replace array element(subset) to stick the data in the right place.
Let me know if I can be of further assistance.
Ben