parametric game fules. minor simulator refactoring

This commit is contained in:
azykov@mail.ru
2026-02-19 22:19:05 +03:00
parent ef5caab748
commit d07f2043e7
22 changed files with 1170 additions and 181 deletions
+14
View File
@@ -0,0 +1,14 @@
import moment from "moment";
export function now(): number {
return (performance.now() + performance.timeOrigin) / 1000;
}
export function formatTime(time: number, format: 'full' | 'short' = 'full'): string {
if (format === 'short')
return moment.utc(time * 1000).format('HH:mm:ss.SSS');
else
return moment.utc(time * 1000).format('HH:mm:ss');
// return moment.utc(time * 1000).format('HH:mm:ss.SSS');
// return durationFormat.format({ seconds: Math.round(time * 1000) });
}