Skip to content

Commit 6ed19d2

Browse files
committed
Measure angular app startup and bootstrap time.
1 parent 7fe4ec4 commit 6ed19d2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ng-sample/src/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as profiling from "./profiling";
2+
profiling.start('application-start');
13
import application = require("application");
24

35
//TODO: hide this in a separate module e.g. "angular-application"

ng-sample/src/main-page.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as profiling from "./profiling";
12
import {topmost} from 'ui/frame';
23
import {TextView} from 'ui/text-view';
34

@@ -8,11 +9,15 @@ import {Benchmark} from './benchmark';
89

910
//TODO: move to an angular init module/base page class
1011
export function pageLoaded(args) {
12+
profiling.stop('application-start');
13+
1114
var page = args.object;
1215
page.bindingContext = "";
1316

17+
profiling.start('ng-bootstrap');
1418
console.log('BOOTSTRAPPING...');
1519
nativeScriptBootstrap(Benchmark, []).then((appRef) => {
20+
profiling.stop('ng-bootstrap');
1621
console.log('ANGULAR BOOTSTRAP DONE.');
1722
}, (err) =>{
1823
console.log('ERROR BOOTSTRAPPING ANGULAR');

0 commit comments

Comments
 (0)