commit 36e1c9272fa9b86cbe9e53e03e83799820674f17 Author: zomars <zomars@me.com> Date: Tue Jul 26 18:27:57 2022 -0600 Update [schedule].tsx commit f39535feea22a11a857d179f3506803602a95728 Author: zomars <zomars@me.com> Date: Tue Jul 26 18:07:30 2022 -0600 Update [status].tsx commit c3ac1bcc8c7ff8dc7ebf178d23a6e5c7ea223749 Author: zomars <zomars@me.com> Date: Tue Jul 26 17:53:43 2022 -0600 Update [schedule].tsx commit 39364d8476b3c582d4a7fe3f8d139c5d254e3ecf Author: zomars <zomars@me.com> Date: Tue Jul 26 17:43:13 2022 -0600 Debugging prod commit 4b428d22dec734dab19096b4fe07741f18e5bc5d Author: zomars <zomars@me.com> Date: Tue Jul 26 17:20:44 2022 -0600 Update checkLicense.ts commit 4212e6d61908face52d647bb661d71db959cf864 Author: zomars <zomars@me.com> Date: Tue Jul 26 17:11:37 2022 -0600 Booking fixes attempt commit e3160027ea0ce40d129b445daeb3bb17711ac640 Author: zomars <zomars@me.com> Date: Tue Jul 26 13:52:35 2022 -0600 migration conflict fixes
26 lines
728 B
TypeScript
26 lines
728 B
TypeScript
import { PerformanceObserver } from "perf_hooks";
|
|
|
|
declare global {
|
|
// eslint-disable-next-line no-var
|
|
var perfObserver: PerformanceObserver | undefined;
|
|
}
|
|
export const perfObserver =
|
|
globalThis.perfObserver ||
|
|
new PerformanceObserver((items) => {
|
|
items.getEntries().forEach((entry) => {
|
|
// Log entry duration in seconds with four decimal places.
|
|
if (!!process.env.NEXT_PUBLIC_DEBUG)
|
|
console.log(entry.name.replace("$1", `${(entry.duration / 1000.0).toFixed(4)}s`));
|
|
});
|
|
});
|
|
|
|
perfObserver.observe({ entryTypes: ["measure"] });
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
globalThis.perfObserver = perfObserver;
|
|
}
|
|
|
|
export default perfObserver;
|
|
|
|
export { performance } from "perf_hooks";
|