feat: debugmode full request
This commit is contained in:
16
src/lib/hoc/withPageTiming.tsx
Normal file
16
src/lib/hoc/withPageTiming.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { DebugService } from "@/lib/services/debug.service";
|
||||
|
||||
type PageComponent = (props: any) => Promise<JSX.Element> | JSX.Element;
|
||||
|
||||
export function withPageTiming(pageName: string, Component: PageComponent) {
|
||||
return async function PageWithTiming(props: any) {
|
||||
const start = performance.now();
|
||||
const result = await Promise.resolve(Component(props));
|
||||
const duration = performance.now() - start;
|
||||
|
||||
// Log le temps de rendu
|
||||
await DebugService.logPageRender(pageName, duration);
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user