How to create non-blocking DC motor activation with timing

Hi there,
I am attempting to create an automatic project that rely of 4 dc pumps, all of them are controlled using time. for now, i can only do it with delay syntax (blocking code), and don't know how to implement non-blocking method for this code. anyone can guide me how to make it non-blocking?
here is the test code (of course the whole project code is not finished, just test code at this moment):

#define pompa_a 7
#define pompa_b 8
#define pompa_c 9
#define pompa_d 10
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(pompa_a, OUTPUT);
  pinMode(pompa_b, OUTPUT);
  pinMode(pompa_c, OUTPUT);
  pinMode(pompa_d, OUTPUT);
  pompaNuang (pompa_b, 80); 
}

void loop() {
  // put your main code here, to run repeatedly:

}

void pompaNuang (int pump, int ml){
  int pompa;
  double y;
  switch (pump) {
    case pompa_a:
      pompa = pompa_a;
      y = -0.0568 * (ml^2) + 66.154 * ml;
      break;
    case pompa_b:
      pompa = pompa_b;
      y = -0.0268 * (ml^2) + 53.651 * ml;
      break;
    case pompa_c:
      pompa = pompa_c;
      y = -0.0223 * (ml^2) + 49.775 * ml;
      break;
    case pompa_d:
      pompa = pompa_d;
      y = -0.0505 * (ml^2) + 64.876 *ml;
      break;
    default:
      Serial.println("wrong pin");
  }
  Serial.print("start pump:");
  Serial.print(pompa);
  Serial.print(", duration:");
  Serial.println (int(y));
  digitalWrite(pompa, HIGH);
  delay(int(y));
  digitalWrite(pompa,LOW);
}

Thank you very much.

There is an example code "Blink without delay". Take a look at it!
There's also "Do several things at the same time" that can be useful.
You'll find tbem in the IDE eamples.

This is really the right opportunity to implement your first C++ class

A possible good start point (but you can find many others on the net)

A working example starting from your test:
Wokwi - Online ESP32, STM32, Arduino Simulator

Hi,
Thank you for your suggestions. i will look at it!

Hi,
Thank you for your code. Very useful!

In case who wondering, here is the updated version of the code so you can run the motor anytime:
4_pumps_with_separate_pour