Skip to content

Commit

Permalink
feat: add hrtime2us
Browse files Browse the repository at this point in the history
Add conversion to microseconds.
  • Loading branch information
dnlup committed Nov 7, 2020
1 parent 7e224b9 commit 65ce4f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ exports.hrtime2ns = function (time) {
return time[0] * 1e9 + time[1]
}

exports.hrtime2us = function (time) {
return time[0] * 1e6 + time[1] / 1e3
}

exports.hrtime2ms = function (time) {
return time[0] * 1e3 + time[1] / 1e6
}
Expand Down

0 comments on commit 65ce4f3

Please sign in to comment.