How to use the @microsoft/rush-lib.Stopwatch.start function in @microsoft/rush-lib

To help you get started, we’ve selected a few @microsoft/rush-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / rushstack / rush / rush / src / actions / LinkAction.ts View on Github external
protected onExecute(): void {
    this._rushConfiguration = this._rushConfiguration = RushConfiguration.loadFromDefaultLocation();

    console.log('Starting "rush link"');
    const stopwatch: Stopwatch = Stopwatch.start();

    readPackageTree(this._rushConfiguration.commonFolder, (error: Error, npmPackage: PackageNode) => {
      this._parser.trapErrors(() => {
        if (error) {
          throw error;
        } else {
          const commonRootPackage: Package = Package.createFromNpm(npmPackage);

          const commonPackageLookup: PackageLookup = new PackageLookup();
          commonPackageLookup.loadTree(commonRootPackage);

          const rushLinkJson: IRushLinkJson = { localLinks: {} };

          for (const rushProject of this._rushConfiguration.projects) {
            console.log(os.EOL + 'LINKING: ' + rushProject.packageName);
            linkProject(rushProject, commonRootPackage, commonPackageLookup, this._rushConfiguration, rushLinkJson);