How does Piwik measure backend Page Generation Speed?

This value represents the average amount of time it takes to load a page in your website and includes both the time it takes for your webserver to generate the page, and the time it takes for your visitor to download it.

How does Piwik accomplish this?

While it is possible to check how long a page took to render on modern browsers even with the tracking script at the bottom, I don’t understand how you would be able to measure the it took to generate the page server-side.

Does anyone know?

Using DOM Timing API, see 301 Moved Permanently