Skip to content

Commit d0f8069

Browse files
committed
Use pretty-hrtime for time formatting
1 parent dc03d51 commit d0f8069

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const fs = require('fs-extra')
44
const path = require('path')
55

66
const ora = require('ora')
7+
const prettyHrtime = require('pretty-hrtime')
78
const stdin = require('get-stdin')
89
const read = require('read-cache')
910
const chalk = require('chalk')
@@ -326,7 +327,7 @@ function css (css, file) {
326327
}
327328
} else {
328329
spinner.text = chalk.bold.green(
329-
`Finished ${relativePath} (${Math.round(process.hrtime(time)[1] / 1e6)}ms)`
330+
`Finished ${relativePath} (${prettyHrtime(process.hrtime(time))})`
330331
)
331332
spinner.succeed()
332333
return process.stdout.write(result.css, 'utf8')
@@ -335,7 +336,7 @@ function css (css, file) {
335336
return Promise.all(tasks)
336337
.then(() => {
337338
spinner.text = chalk.bold.green(
338-
`Finished ${relativePath} (${Math.round(process.hrtime(time)[1] / 1e6)}ms)`
339+
`Finished ${relativePath} (${prettyHrtime(process.hrtime(time))})`
339340
)
340341
if (result.warnings().length) {
341342
spinner.fail()

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"postcss": "^6.0.1",
2727
"postcss-load-config": "^1.1.0",
2828
"postcss-reporter": "^4.0.0",
29+
"pretty-hrtime": "^1.0.3",
2930
"read-cache": "^1.0.0",
3031
"yargs": "^8.0.1"
3132
},

0 commit comments

Comments
 (0)