I am getting the following error when attempting to run the above code: AttributeError: 'Float' object has no attribute 'time'. I have seen some solutions that involve changing the dtype to object, but I am unsure why that would be necessary and how to implement it.
The issue is that the variable time is being overwritten by the float value 0.0 in the __init__ method. Therefore, when time.time() is called in the timer method, it is actually trying to call float.time(), which raises the AttributeError.
To resolve this issue, simply change the name of the time variable in the __init__ method to something else, such as self.delay.