mirror of
https://git.hibas.dev/OpenServer/NodeLogging.git
synced 2026-01-10 16:27:11 +00:00
Update time functions
This commit is contained in:
@@ -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