diff --git a/src/cryptoApi.ts b/src/cryptoApi.ts index 2d2363770..dbadb45e4 100644 --- a/src/cryptoApi.ts +++ b/src/cryptoApi.ts @@ -187,8 +187,9 @@ export class CryptoApi { private doRpc(operation: string, priority: number, ...args: any[]): Promise { + let start = performance.now(); - return new Promise((resolve, reject) => { + let p = new Promise((resolve, reject) => { let rpcId = this.nextRpcId++; let workItem: WorkItem = {operation, args, resolve, reject, rpcId}; @@ -213,6 +214,11 @@ export class CryptoApi { throw Error("assertion failed"); }); + + return p.then((r) => { + console.log(`rpc ${operation} took ${performance.now() - start}ms`); + return r; + }); }