aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/time.ts')
-rw-r--r--src/util/time.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util/time.ts b/src/util/time.ts
index 88297f9a9..2740c361f 100644
--- a/src/util/time.ts
+++ b/src/util/time.ts
@@ -34,9 +34,15 @@ export interface Duration {
readonly d_ms: number | "forever";
}
+let timeshift: number = 0;
+
+export function setDangerousTimetravel(dt: number) {
+ timeshift = dt;
+}
+
export function getTimestampNow(): Timestamp {
return {
- t_ms: new Date().getTime(),
+ t_ms: new Date().getTime() + timeshift,
};
}