Calculate well the ms speed for macros

how can you figure out what speed to run the macro, do you have to calculate ms lag of the game or are there other factors? for example, I have a lag of 35.40 ms in the game so how do you understand it?