diff --git a/can/broadcastmanager.py b/can/broadcastmanager.py index 6ca9c61b3..0fa94c82c 100644 --- a/can/broadcastmanager.py +++ b/can/broadcastmanager.py @@ -308,6 +308,9 @@ def __init__( self.event: Optional[_Pywin32Event] = None if PYWIN32: + if self.period_ms == 0: + # A period of 0 would mean that the timer is signaled only once + raise ValueError("The period cannot be smaller than 0.001 (1 ms)") self.event = PYWIN32.create_timer() elif ( sys.platform == "win32"