How to calculate flight time remaining?

I was wondering how to calculate current flight time remaining ? I can’t find departure time in any api provided? So how does Liveflight get remaining flight time and time already flew, even est total flight?
which parameter can be used to calculate it?

I think LiveFlight uses Ground Speed and the distance of the flight plan (calculated using coordinates of each waypoint).