Creating my own PWM

"Serial.println(VoltageIn , DEC);" takes a long time to execute.

How will that affect the PWM?