diff --git a/server/src/core/hrtime-core.ts b/server/src/core/hrtime-core.ts new file mode 100644 index 000000000..140023f27 --- /dev/null +++ b/server/src/core/hrtime-core.ts @@ -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; +}