How to use pretty-hrtime - 9 common examples

To help you get started, we’ve selected a few pretty-hrtime 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 storybookjs / storybook / lib / core / src / server / build-dev.js View on Github external
paddingLeft: 0,
    paddingRight: 0,
    paddingTop: 0,
    paddingBottom: 0,
  });

  serveMessage.push(
    ['Local:', chalk.cyan(address)],
    ['On your network:', chalk.cyan(networkAddress)]
  );

  const timeStatement = previewTotalTime
    ? `${chalk.underline(prettyTime(managerTotalTime))} for manager and ${chalk.underline(
        prettyTime(previewTotalTime)
      )} for preview`
    : `${chalk.underline(prettyTime(managerTotalTime))}`;

  // eslint-disable-next-line no-console
  console.log(
    boxen(
      dedent`
          ${colors.green(`Storybook ${chalk.bold(version)} started`)}
          ${chalk.gray(timeStatement)}

          ${serveMessage.toString()}${updateMessage ? `\n\n${updateMessage}` : ''}
        `,
      { borderStyle: 'round', padding: 1, borderColor: '#F1618C' }
    )
  );
}
github storybookjs / storybook / lib / core / src / server / build-dev.js View on Github external
middle: '',
    },
    paddingLeft: 0,
    paddingRight: 0,
    paddingTop: 0,
    paddingBottom: 0,
  });

  serveMessage.push(
    ['Local:', chalk.cyan(address)],
    ['On your network:', chalk.cyan(networkAddress)]
  );

  const timeStatement = previewTotalTime
    ? `${chalk.underline(prettyTime(managerTotalTime))} for manager and ${chalk.underline(
        prettyTime(previewTotalTime)
      )} for preview`
    : `${chalk.underline(prettyTime(managerTotalTime))}`;

  // eslint-disable-next-line no-console
  console.log(
    boxen(
      dedent`
          ${colors.green(`Storybook ${chalk.bold(version)} started`)}
          ${chalk.gray(timeStatement)}

          ${serveMessage.toString()}${updateMessage ? `\n\n${updateMessage}` : ''}
        `,
      { borderStyle: 'round', padding: 1, borderColor: '#F1618C' }
    )
  );
}
github shipitjs / shipit / packages / shipit-cli / src / Shipit.js View on Github external
this.on('task_stop', e => {
      const task = this.tasks[e.task]
      // Specific log for noop functions.
      if (task.fn.toString() === 'function () {}') {
        this.log(
          'Finished',
          `'${chalk.cyan(e.task)}'`,
          chalk.cyan(`[ ${task.dep.join(', ')} ]`),
        )
        return
      }

      const time = prettyTime(e.hrDuration)
      this.log(
        'Finished',
        `'${chalk.cyan(e.task)}'`,
        'after',
        chalk.magenta(time),
      )
    })
github StormFireGame / game / public / gulpfile.babel.js View on Github external
end() {
    const taskTime = process.hrtime(startTime);
    const prettyTime = prettyHrtime(taskTime);

    $.util.log('Bundled in', $.util.colors.magenta(prettyTime));
  }
};
github gajus / seeql / src / index.js View on Github external
data: drawQueries.map((query) => {
      return [
        query.connectionId,
        query.queryId,
        formatSql(query.sql).slice(0, 50),
        query.rows.length,
        prettyHrtime(query.executionTime)
      ];
    }),
    headers: [
github egoist / mkfile / src / task.js View on Github external
o.on('task_stop', e => {
  log('Finished', `'${e.task}'`.cyan, `in ${prettyHrtime(e.hrDuration)}`)
})
github storybookjs / storybook / lib / node-logger / src / index.ts View on Github external
trace: ({ message, time }: { message: string; time: [number, number] }): void =>
    npmLog.info('', `${message} (${colors.purple(prettyTime(time))})`),
};
github GrimoireGL / GrimoireJS / gulpfile.babel.js View on Github external
.on('end', () => {
        gutil.log('Finished bundling ' + gutil.colors.magenta(ptime(process.hrtime(time))));
      });
  }
github postcss / postcss-devtools / src / index.js View on Github external
const updateSummary = (summary, {plugin, rawTime}, {precise}) => {
    const summaryForPlugin = summary[plugin] || {rawTime: [0, 0]};
    const newRawTime = hrtimeAdd(summaryForPlugin.rawTime, rawTime);
    const formatted = pretty(newRawTime, {precise});
    const text = 'Completed in ' + pretty(newRawTime, {precise});
    const time = convert(newRawTime);
    return {
        ...summary,
        [plugin]: {rawTime: newRawTime, formatted, text, time},
    };
};

pretty-hrtime

process.hrtime() to words

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis

Popular pretty-hrtime functions