summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-12-20 13:05:09 +0100
committerxengineering <me@xengineering.eu>2025-12-20 13:05:09 +0100
commit7bc3ce328d61c1afe138802ded812d718b056257 (patch)
treeddb006f1a11dd5831bab8749d99b5a2eb35f7b76 /main.go
parent853e3fd5f2b4e622d4e35c0e3c2fad6c358cb8ae (diff)
downloadsia-server-7bc3ce328d61c1afe138802ded812d718b056257.tar
sia-server-7bc3ce328d61c1afe138802ded812d718b056257.tar.zst
sia-server-7bc3ce328d61c1afe138802ded812d718b056257.zip
Reduce polling period to 50 ms
The human reaction time is roughly 100 ms. The Nyquist-Shannon sampling theorem [1] is used for an approximation how often it is required to sample without humans noticing any delays. [1]: https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
Diffstat (limited to 'main.go')
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.go b/main.go
index 051deef..6f1695d 100644
--- a/main.go
+++ b/main.go
@@ -21,7 +21,7 @@ const (
RETAINED = false
MQTT_CONNECT_TIMEOUT = time.Second * 5
MQTT_DISCONNECT_TIMEOUT_US = 500
- POLLING_PERIOD = 500 * time.Millisecond
+ POLLING_PERIOD = 50 * time.Millisecond
)
func main() {