parametric game fules. minor simulator refactoring
This commit is contained in:
@@ -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) });
|
||||
}
|
||||
Reference in New Issue
Block a user