profiler.ts 471 B

1234567891011121314151617
  1. export class Profiler {
  2. panelsRendered = 0;
  3. enabled?: boolean = undefined;
  4. renderingCompleted() {
  5. // add render counter to root scope
  6. // used by image renderer to know when panel has rendered
  7. this.panelsRendered += 1;
  8. // this window variable is used by backend rendering tools to know
  9. // all panels have completed rendering
  10. (window as any).panelsRendered = this.panelsRendered;
  11. }
  12. }
  13. const profiler = new Profiler();
  14. export { profiler };