add groups feature

This commit is contained in:
Denis barbaron
2019-06-12 10:29:07 +02:00
parent 6fd750dad5
commit 7f5dc4c152
119 changed files with 12416 additions and 402 deletions

22
lib/util/timeutil.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* Copyright © 2019 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
**/
const timeutil = Object.create(null)
timeutil.now = function(unit) {
const hrTime = process.hrtime()
switch (unit) {
case 'milli':
return hrTime[0] * 1000 + hrTime[1] / 1000000
case 'micro':
return hrTime[0] * 1000000 + hrTime[1] / 1000
case 'nano':
return hrTime[0] * 1000000000 + hrTime[1]
default:
return hrTime[0] * 1000000000 + hrTime[1]
}
}
module.exports = timeutil