How to get page generation time from piwik database

Hi,

I need to get page generation time with a script from piwik database for other purposes. I know that it can visualised in a report using the api but I need to get it directly from the concerned tables. Can anyone tell me how it is calculated ?

Thank you !