multiple sensors and baud rate (lidar, gps, logger)

Hi all, I have a generic question and looking for some advice.
I have an

  1. adruino mega
  2. TFMini Lidar
  3. GPS NEO6-M
  4. SD card

Lidar and GPS have their own com port on the Arduino.

My setup, reads in the loop() function the lidar data, the gps positions and saves it on the sd card syncing on the timestamp of the measure.

The data coming from the lidar are at much higher rate than gps data but still you read it sequential

read_lidar function
read_gps function
save_to_sd function

Thus, I get 1 lidar measure, 1 GPS measure, and save to disk. What I want is the for the time the gps takes a measure, to save as much as possible from the lidar.

Is anyway, while the loop() waits for the GPS data baud rate, to keep reading the lidar sensor? In other words, how could i write a script, that gets data in parallel and based on the baud rate get say 10 lidar measures and 1 GPS reading?

Thanks in advace