Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclical latency changes #553

Closed
MadlyFX opened this issue Jul 24, 2020 · 0 comments
Closed

Cyclical latency changes #553

MadlyFX opened this issue Jul 24, 2020 · 0 comments

Comments

@MadlyFX
Copy link

MadlyFX commented Jul 24, 2020

Here's a fun one. Using the SocketIO library from timum-viw, I implemented these simple functions:

Server:

var interval = setInterval(test, 5000);
function test() {
  	nowTime = Date.now();
	io.emit('my_ping');
}
socket.on('my_pong', () => {
        nowTime = Date.now() - nowTime;
        console.log(nowTime);
    })

Client (ESP32):

void my_ping(const char * payload, size_t length) {
  webSocket.emit("my_pong");
}

And let it run. The result? Over the course of 30 seconds, the latency slowly creases to around 100ms, then "resets" to around 30.

31
44
58
75
94
108
28
42
58
75
92
114
22
53
57
75
90
108
25
41
56
75
92
107
25
45
64
77
97
111
25
43
62
77
94
111

What could be causing this?

@MadlyFX MadlyFX closed this as completed Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant