add hrtime utils

This commit is contained in:
zkldi
2021-04-27 00:12:23 +01:00
parent 3904bb83ad
commit 6c1454259d
+7
View File
@@ -0,0 +1,7 @@
/**
* Takes a process.hrtime.bigint(), and returns the miliseconds elapsed since it.
* This function will not work if more than 100(ish) days have passed since the first reference.
*/
export function GetMilisecondsSince(ref: bigint) {
return Number(process.hrtime.bigint() - ref) / 1e6;
}