middleware/server_timing library

Classes

ServerTiming
Adds a Server-Timing header to the answer. The browser dev tools show it in the Network tab.

Functions

serverTimingOn() → bool
Not exported. true when the ServerTiming middleware is on for the current request. The router checks it before it times the controller, so a route without the middleware pays nothing more.
timeHandler(FutureOr fn()) → Future
Not exported. Runs the controller fn and adds its time as handler, also when it throws. Call it only when serverTimingOn.