measure ws connect time
This commit is contained in:
parent
df3f5e170b
commit
7f6e946c2b
1 changed files with 3 additions and 1 deletions
|
@ -49,13 +49,15 @@ export default class StreamingClient extends NanoEvents {
|
|||
}
|
||||
|
||||
connect () {
|
||||
const begin = Date.now()
|
||||
log('connecting')
|
||||
|
||||
const ws = this.ws = new WebSocket(this.url)
|
||||
window.ws = ws
|
||||
|
||||
ws.onopen = () => {
|
||||
log('connected')
|
||||
const took = Date.now() - begin
|
||||
log(`connected (took ${took}ms)`)
|
||||
this.subscribe()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue