8000 Substract timestamps using ticks_diff() to account for wrap around by fgervais · Pull Request #36 · blynkkk/lib-python · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Substract timestamps using ticks_diff() to account for wrap around #36

Merged
merged 1 commit into from 8000
Aug 19, 2020

Conversation

fgervais
Copy link
Contributor
@fgervais fgervais commented Aug 7, 2020

From the utime documentation, ticks_diff() should be used to compare
timestamps. They say the wrap around is implementation specific but on
forums I see people saying it's about 298 hours/12 days which at least
is the case for me on the tinypico.

In this specific case, the wrap around means the deltas will be small
negative numbers which in turn will make is_server_alive() return True
for days without sending anymore pings to the server. We will soon after
get disconnected and the application will pretty much stay forever in
that state.

From the utime documentation, ticks_diff() should be used to compare
timestamps. They say the wrap around is implementation specific but on
forums I see people saying it's about 298 hours/12 days which at least
is the case for me on the tinypico.

In this specific case, the wrap around means the deltas will be small
negative numbers which in turn will make is_server_alive() return True
for days without sending anymore pings to the server. We will soon after
get disconnected and the application will pretty much stay forever in
that state.
@antohaUa antohaUa merged commit ca5949b into blynkkk:master Aug 19, 2020
@antohaUa
Copy link
Collaborator

Thx for this found case.

1 similar comment
@antohaUa
Copy link
Collaborator

Thx for this found case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0