bidirectional serial communication:simultaneous sensor readout and motor control

So now I managed to have a system reading the values and allowing at the same time to turn the motor on/off. This was obtained using the code above removing the while loop in data().
The only problem I still have is the "time stamp". Every time the motor starts a new time stamp is created also each data ponit during data() has the time stamp of the delay (5000 ms). I would like to have a continuous time running from the initioation of the programm till the termination performed by the user. Is this possible? Or would you reccommend, since I'm going to use LabView to readout and store the data, to use LabView to clear the time problem?

Thank you for your help!