Update time functions
This commit is contained in:
3269
package-lock.json
generated
3269
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hibas123/nodelogging",
|
||||
"packageManager": "yarn@3.6.4",
|
||||
"version": "3.1.6",
|
||||
"version": "4.0.1",
|
||||
"description": "",
|
||||
"main": "out/index.js",
|
||||
"types": "out/index.d.ts",
|
||||
@ -30,13 +30,13 @@
|
||||
"readme.md"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.6",
|
||||
"concurrently": "^8.2.1",
|
||||
"nodemon": "^3.0.1",
|
||||
"typescript": "^5.2.2"
|
||||
"@types/node": "^24.9.1",
|
||||
"concurrently": "^9.2.1",
|
||||
"nodemon": "^3.1.10",
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hibas123/logging": "^3.1.2",
|
||||
"@hibas123/logging": "^4.0.2",
|
||||
"@hibas123/utils": "^2.2.18"
|
||||
}
|
||||
}
|
@ -11,6 +11,14 @@ LoggingBase.nativeFunctions = {
|
||||
return process.hrtime();
|
||||
}
|
||||
},
|
||||
diffTime: (start, end) => {
|
||||
if (process.hrtime.bigint) {
|
||||
return Number((BigInt(end) - BigInt(start)) / BigInt(1000)) / 1000;
|
||||
} else {
|
||||
let diff = process.hrtime(start);
|
||||
return diff[0] * 1000 + diff[1] / 1000000;
|
||||
}
|
||||
},
|
||||
endTimer: (start) => {
|
||||
if (process.hrtime.bigint) {
|
||||
return Number((process.hrtime.bigint() - start) / BigInt(1000)) / 1000;
|
||||
|
Reference in New Issue
Block a user