How to execute functions simultaneously in this case?

https://forum.arduino.cc/index.php?topic=223286.0