Arduino Uno: strange processing delay

The Arduino Uno receives a message on serial input, but subsequent action is delayed by several 100ms.
Program code below, what could be the reason for this delay.

int red = 2;
int green = 3;
int blue = 4;

void setup() {
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);

void loop() {
  String input = Serial.readString();
  if (input == "SEND1") {
    digitalWrite(red, HIGH);
  if (input == "SEND0") {
    digitalWrite(red, LOW);

Could it be down to the timeout of readString?

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. This can happen after the program has been running perfectly for some time. Just use cstrings - char arrays terminated with '\0' (NULL).

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.