Is it safe to run arduino uno 24/7 with usb as power to cellphone charger?

How do you do that?, I once created that with a timer that when it detects no sun it will count down 20 seconds and it will go to sleep. But as a result it starts to affect the rotation of the servo due of the delay it start to slow down like 40 seconds delay of the rotation so if you any suggestion how to prevent affecting delays please leave a comment also this code is the struggle that I have.

/** if (lt + rt + ld + rd <= 200){

display.setBrightness(0, true);

count--;

delay(TEST_DELAY);

//runOnce = 1;

display.setBrightness(0, true);

Serial.println("no Sun Detected/n");

//LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}else {

count = 0;
display.setBrightness(0, false);

horizontal.attach(9);
vertical.attach(10);
Serial.println("Sun Detected Sun Detected Sun Detected\n");
delay(10000);
count--;
}

**/

this is not the full code but this is just the one when it is enable it starts to change the way the servo reacts, also this is inside the void loop