Voltage spikes in Arduino uno r3 with USB

I am experimenting with a type of clock that uses pulses PWM from pin 10. For the most part The pulses are steady and accurate. But for example I plug something else into another usb port on my computer the second counter skips ahead a bit. I am affraid to even put my computer on stand by incase a voltage spike destroys my time accuracy test.

Does the Arduino uno have a built in voltage regulator? I am assuming no because of this effect. Is there ways I can eliminate this effect, or do I have to put a voltage regulator on every circuit I make.

It does, but the regulator only comes into play when it is powered through the Vin. When it is powered by USB, the 5V USB supply is connected directly to Vcc. If you power your project through a 7.5V wall-wart then the UNO's own regulator will provide the 5V Vcc.

Thankyou gardner. Ill try testing it with a battery instead.

I think your arduino resets when another USB device is plugged into your computer.