I would like to add 1 to a variable every minute without interfering with the code that's already running.
It is a game so I want in the background for wood+1, rock+1, fish+1 to happen every minute without the user knowing.
the time.sleep won't work in this situation because it pauses the whole program.
start=time.time()
#some code
end=time.time()
if end-start > 60:
wood = wood+1
rock = rock+1
I tried doing something above but could not get it to continuously count. It only measures how long it takes for #some code to be executed.
Any help would be great! Thanks in advance.