lasttick = -0.01 tick = float(0.00) while True: tick = tick + float(0.01) if tick > lasttick: #Your tick update here: print(tick) #Prints the tick lasttick = lasttick + 0.01
Here is what the above code is Doing:
1. It’s creating a variable called lasttick and setting it to -0.01
2. It’s creating a variable called tick and setting it to 0.00
3. It’s creating a while loop that will run forever
4. It’s adding 0.01 to the tick variable
5. It’s checking if the tick variable is greater than the lasttick variable
6. If it is, it will print the tick variable
7. It will set the lasttick variable to the lasttick variable plus 0.01
8. It will go back to step 4 and repeat the process
The reason we set the lasttick variable to -0.01 is so that the first time the code runs, it will print the tick.
You can change the 0.01 to whatever you want. If you want it to run faster, make it a smaller number. If you want it to run slower, make it a larger number.
I hope this helps!