Natron Time Remaining and Total time taken for a render session

Hi ,
I am curious how Natron host displays the “Time Remaining” on the GUI. How is the function invoked?

Also, can we display the total time taken for a render session?

Regards,
Rashmi

If I have rendered 20 frames in 30s, and there are 160 frames in the sequence, then the remaining time is (160-20)*30/20 (number of remaining frames times the average time spent rendering one frame).