You could determine the elapsed time by calling time.time()
, and taking the difference.
i have to change color of lights(sphere) every X seconds
Say you last changed the colour at time T
. Keep calling time.time()
inside the loop, and change the colour again when time.time() - T
exceeds X
.