Use millis() instead of counter
Use millis() intead of counter