have you tried this which would be more representative of bulk data transfer?
unsigned long startClock = micros();
for (int i = 1000; i > 0; i--) Serial.write(BYTE_TO_SEND);
Serial.flush();
unsigned long endClock = micros();
(and you have the cost of the for loop - so you might want to transfer 1000 bytes from an array (or random location) in memory) - may be it's more efficient at iterating
const byte BYTE_TO_SEND = 170; //b'10101010'.
const unsigned long NUMERATOR = 1000000000;
byte buffer[1000];
void setup() {
Serial.begin(115200); //Does nothing on the nano 33 ble sense.
while (!Serial); //Wait for serial port to connect. Needed for native USB on nano 33 ble sense.
memset(buffer, sizeof buffer, BYTE_TO_SEND);
unsigned long startClock = micros();
Serial.write(buffer, sizeof buffer);
Serial.flush();
unsigned long endClock = micros();
unsigned long bytesPerSecond = NUMERATOR / (endClock - startClock);
Serial.println();
Serial.print(bytesPerSecond);
Serial.println(" bytes/second");
}
void loop() {}