diff --git a/src/index.ts b/src/index.ts index b870c61..55741f2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,6 +12,8 @@ export const server = createServer({ }) server.on('login', client => { + console.info(`${client.username} has connected!`) + // eslint-disable-next-line no-new new Instance(client) }) diff --git a/src/instance/index.ts b/src/instance/index.ts index 8c2358d..cb466d2 100644 --- a/src/instance/index.ts +++ b/src/instance/index.ts @@ -37,9 +37,21 @@ export class Instance { console.error('Target error:', error) }) + console.info('Initializing worker... (local context)') + + const start = performance.now() + const worker = new Worker(WORKER_PATH) this.worker = worker + worker.on('online', () => { + const end = performance.now() + + const delta = end - start + + console.info(`Worker online! took ${delta.toFixed(2)}ms`) + }) + worker.on('error', error => { console.error('Worker error:', error) })