Skip to content

Commit fb0a7b8

Browse files
amaaniqbalrigor789
andauthored
feat: compute and log build time (#5602)
* Compute and log build time * chore: cleanup Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
1 parent 0be52e9 commit fb0a7b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/controllers/build-controller.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class BuildController extends EventEmitter implements IBuildController {
4343

4444
public async build(buildData: IBuildData): Promise<string> {
4545
this.$logger.info("Building project...");
46+
const startTime = performance.now();
4647

4748
const platform = buildData.platform.toLowerCase();
4849
const projectData = this.$projectDataService.getProjectData(
@@ -102,7 +103,11 @@ export class BuildController extends EventEmitter implements IBuildController {
102103
buildInfoFileDir
103104
);
104105

106+
const endTime = performance.now();
107+
const buildTime = (endTime - startTime) / 1000;
108+
105109
this.$logger.info("Project successfully built.");
110+
this.$logger.info(`Build time: ${buildTime.toFixed(3)} s.`);
106111

107112
const result = await this.$buildArtefactsService.getLatestAppPackagePath(
108113
platformData,

0 commit comments

Comments
 (0)