diff options
Diffstat (limited to 'src/cryptoApi.ts')
-rw-r--r-- | src/cryptoApi.ts | 8 |
1 files changed, 7 insertions, 1 deletions
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<T>(operation: string, priority: number, ...args: any[]): Promise<T> { + 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; + }); } |