Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1275

Python • Is sleep function is not accurete in python?

$
0
0
Is there a better solution instead for using the sleep command with pyhton on a raspberry pi board?
My python program has sleep(1), which means one second delay and when the code has run for 3600 times it runs a MySQL insert command.
The problem is that the "delay" is not of all accurate. It may be a 1-2 minutes difference after every 3600 seconds when it runs the MySQL insert command.

Some info about my environment.
Python version: 3.10.12
Ubuntu version: 22.04.4 LTS
Board version: Raspberry Pi 4 Model B Rev 1.5

Statistics: Posted by Kenne76 — Sat Jun 22, 2024 3:18 pm



Viewing all articles
Browse latest Browse all 1275

Trending Articles