From 5be64b96971df4872190231b4468d51779c6b841 Mon Sep 17 00:00:00 2001 From: Amaan Iqbal Date: Wed, 27 Oct 2021 20:39:33 +0530 Subject: [PATCH 1/2] Compute and log build time --- lib/controllers/build-controller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/controllers/build-controller.ts b/lib/controllers/build-controller.ts index 43f611fbfa..5a37859162 100644 --- a/lib/controllers/build-controller.ts +++ b/lib/controllers/build-controller.ts @@ -43,6 +43,7 @@ export class BuildController extends EventEmitter implements IBuildController { public async build(buildData: IBuildData): Promise { this.$logger.info("Building project..."); + const startTime = performance.now(); const platform = buildData.platform.toLowerCase(); const projectData = this.$projectDataService.getProjectData( @@ -102,7 +103,10 @@ export class BuildController extends EventEmitter implements IBuildController { buildInfoFileDir ); + const endTime = performance.now(); this.$logger.info("Project successfully built."); + const buildTime = (endTime - startTime) / 1000; + this.$logger.info(`Build time: ${buildTime.toFixed(3)} s.`); const result = await this.$buildArtefactsService.getLatestAppPackagePath( platformData, From 0232806718d801cca75f5edf39c437d75d4d435c Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Wed, 8 Dec 2021 14:05:52 +0100 Subject: [PATCH 2/2] chore: cleanup --- lib/controllers/build-controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/controllers/build-controller.ts b/lib/controllers/build-controller.ts index 5a37859162..fde3547e0e 100644 --- a/lib/controllers/build-controller.ts +++ b/lib/controllers/build-controller.ts @@ -104,8 +104,9 @@ export class BuildController extends EventEmitter implements IBuildController { ); const endTime = performance.now(); - this.$logger.info("Project successfully built."); const buildTime = (endTime - startTime) / 1000; + + this.$logger.info("Project successfully built."); this.$logger.info(`Build time: ${buildTime.toFixed(3)} s.`); const result = await this.$buildArtefactsService.getLatestAppPackagePath(