Arduino vs. Raspberry Pi/other microcontroller - sampling rate

Noob here.

I'm currently working on a project where I need to be able to measure sound constantly for up to two hours, for frequencies ranging from 20 Hz to 44 kHz. I'm using an Arduino Mega with an adafruit datalogging shield and microphone.

I also have a Raspberry Pi and I have a small amount of funding to buy a different microcontroller or shield if necessary.

I am currently using this code, which is just a slight adjustment to the ReadAnalogVoltage example sketch:

int ind = 1;

void setup() {
Serial.begin(9600);
}

void loop() {
while(ind < 3001) {
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
ind = ind + 1;
delay(10);
}
}

I have been having difficulty determining the sampling rate of the arduino. I am using the delay function to try to control the sampling rate, but it seems to be inaccurate (or my microphone is having problems) because I have been testing it with a 500 Hz signal and measuring 120 Hz and 880 Hz. I also tried setting a timer and printing the time, but this reduces my sampling rate so that I can't record a clear wave.

After asking around I was told that I should find a way to bypass the serial monitor, as it's what's limiting my sampling rate. Will writing directly to the SD card solve this problem? Should I just move to a raspberry pi instead? I know it has a lot more memory and a faster clock. Any suggestions would be appreciated, including telling me to post this to a different forum. Thanks!

Will writing directly to the SD card solve this problem?

It could do there is a special SD library for recording.

Should I just move to a raspberry pi instead?

That is Linux and is not real time, it is no good for sampling.

 float voltage = sensorValue * (5.0 / 1023.0);

Why bother to do complex arithmetic when you do not need it for data storage, you can do that on reply when you need it and when it does not affect your sample rate.