reduce file footprint even more

This commit is contained in:
zkldi
2021-05-20 19:23:40 +01:00
parent aaa642f8ab
commit 7afdb47d56
5 changed files with 11 additions and 10 deletions
-7
View File
@@ -1,7 +0,0 @@
/**
* 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;
}
@@ -1,5 +1,5 @@
import t from "tap";
import { GetMilisecondsSince } from "./hrtime";
import { GetMilisecondsSince } from "./util";
t.test("#GetMilisecondsSince", (t) => {
const time = GetMilisecondsSince(10n);
+8
View File
@@ -32,3 +32,11 @@ export function ParseEA3SoftID(ver: string) {
ext: a[4],
};
}
/**
* 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;
}
@@ -12,7 +12,7 @@ import { ImportInputParser, KtLogger, ScorePlaytypeMap } from "../../types";
import { ImportAllIterableData } from "./score-importing/score-importing";
import { CreateImportLoggerAndID } from "./common/import-logger";
import { CreateSessions } from "./sessions/sessions";
import { GetMilisecondsSince } from "../../common/hrtime";
import { GetMilisecondsSince } from "../../common/util";
import { ProcessPBs } from "./pb/process-pbs";
import { UpdateUsersGamePlaytypeStats } from "./user-game-stats/update-ugs";
import db from "../../db/db";
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import t from "tap";
import { GetMilisecondsSince } from "../../../../common/hrtime";
import { GetMilisecondsSince } from "../../../../common/util";
import { CloseMongoConnection } from "../../../../db/db";
import CreateLogCtx from "../../../../common/logger";
import { MockMulterFile } from "../../../../test-utils/mock-multer";