How to determine sample frequency of sensor data

Hey, I'm new to arduino.
I would like to know how you determine the sample frequency of your analog data.I want to analyze the data further in Matlab, but I should know the sample frequency.
My script goes as follow:

int sensorPin = 0
int val = 0;

void setup() {Serial.begin(9600);
// put your setup code here, to run once:

}

void loop() {
val = analogRead(sensorPin);
// put your main code here, to run repeatedly:,
Serial.println(val);

delay(20);
}

To my understanding the delay(20) command sends a signal after 20 ms therefore corresponding to the sampling interval, thus the sample frequency should be 1/0.02= 50 Hz.

I get confused with baud rate (9600),does it affect the sample frequency?

So if the bps is below the maximal bps then the sample frequency is correct?

1 analog signal=10 bits
Baud rate = 9600
1 baud=10 bits
thus maxium bit rate is 9600*10=96000 bits/sec

Delay=0.02 s or 1/0.02 =50 Hz
10 bits*50 Hz = 500 bits/sec

500bits /sec < 96000 bits/sec -> okay

Thanks , but what would be very fast sampling? if it exceeds 9600 baud I guess?

Print out the value of millis() each time you send data. It isn't a matter for a rocket scientist to determine the frequency.

Play with the baud rate. See what impact it has (none).

Play with the delay() value. See what impact it has (major).

Determine the frequency yourself. Or send the time to matlab and let it figure it out.