// log.ts
const pageLoadTime = performance.now();

function getTimestamp(): string {
	const elapsed = performance.now() - pageLoadTime;

	const hours = Math.floor(elapsed / 3600000);
	const minutes = Math.floor((elapsed % 3600000) / 60000);
	const seconds = Math.floor((elapsed % 60000) / 1000);

	return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
}

export const log = {
	info(...args: any[]): void {
		console.log(`[${getTimestamp()}]`, ...args);
	},

	error(...args: any[]): void {
		console.error(`[${getTimestamp()}]`, ...args);
	},
};
