How to get arduino to print something excatly once every milisecond?

UKHeliBob, yes I changed it.

GrOnThOs, I'm saving values into array and then print whole array at the end.

If there any other possible workaround? For instance to to add some kind of buffer zone to digitalRead (similar to how flip-flop works), so that it has to reach some low value, before being able to change position? I'm using Pololu optical encoder Pololu - Optical Encoder Pair Kit for Micro Metal Gearmotors, 5V.