Skip to content

Instantly share code, notes, and snippets.

@vatsalkgor
Created March 9, 2021 22:56
Show Gist options
  • Save vatsalkgor/3e7988c772eb2e069d0b836d5e0ad5d6 to your computer and use it in GitHub Desktop.
Save vatsalkgor/3e7988c772eb2e069d0b836d5e0ad5d6 to your computer and use it in GitHub Desktop.
Measure Angular change detection cycle time
import 'hammerjs';
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { ApplicationRef, enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { enableDebugTools } from '@angular/platform-browser';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.then(module=> enableDebugTools(module.injector.get(ApplicationRef).components[0]))
.catch(err => console.error(err));
// In console type following
ng.profiler.timeChangeDetection()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment