How to use pretty-time - 3 common examples

To help you get started, we’ve selected a few pretty-time 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 liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / index.ts View on Github external
.then(() => {
				// Report and show execution time
				const hrtime = process.hrtime(start);
				report.executionTime(hrtime);
				log.info(`Bundling took ${pretty(hrtime)}`);

				// Send report analytics data
				report.sendAnalytics();

				// Write report if requested
				if (project.misc.reportFile) {
					fs.writeFileSync(
						project.misc.reportFile.asNative,
						report.toHtml()
					);

					log.info(
						`Report written to ${project.misc.reportFile.asNative}`
					);
				} else if (report.warningsPresent) {
					log.debug('The build has emitted some warning messages.');
github umaar / wiki-globe / index.js View on Github external
onWikiData(data => {
		if (!hasLoggedOneWikiEdit) {
			hasLoggedOneWikiEdit = true;
			console.log('Data preview:', data);
		}

		stats.ongoingDataCount++;
		const elapsedTime = process.hrtime(startTime);

		if ((elapsedTime[0] % 200) === 0) {
			console.log(`${stats.ongoingDataCount} wiki edits received after ${prettyTime(elapsedTime)}`);
		}

		io.emit('message', data);
		writeWikiEditToDB(data);
	});
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / report / html.js View on Github external
htmlIf(_executionTime, () =>
			htmlRow(
				`Execution took:${pretty(_executionTime)}`
			)
		),

pretty-time

Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.

MIT
Latest version published 6 years ago

Package Health Score

71 / 100
Full package analysis

Popular pretty-time functions