You are attemping to use a fixed 'time step' by waiting until a specific amount of time has passed and then updating the logic as if that
exact amount of time has passed. Each cycle/tick/frame can be any amount of time and can often be delayed for whatever reason (commonly the OS decides there's something more important to do) so the time passed might actually be a lot higher than your limit but it still updates as if only that time has passed. If, for example, and entire second has passed since the previous update, the position is still update as if 17 milliseconds have passed.
There are a few solutions.
You can multiply the speed by the amount of time passed for that frame; this will scale the movement so that the actual speed is correct.
Your update can stick to a fixed timestep value and have multiple update per frame so that all of the time passed is processed at once but also processed in chunks of your chosen step.
Read
Fix Your Timestep for more information. Note that the "final touch" can be a bit complicated (it certainly took me more than one readthrough) and it often not required but it can add some 'polish' to your movement.
You may also want to consider using
Kairos (a small, C++ timing library) to help aid with this. Have a look at
the example on the wiki to see just how simple it can make it
Note that milliseconds are stored in integer so there is absolutely no point in comparing it with a floating point type, especially with equality. It's effectively the same as milliseconds > 16 or milliseconds >= 17.
If you need smaller time chunks, you
can use seconds as it is a floating point type. However, you could just use the smaller time representation: microseconds. 1000 microseconds = 1 millisecond. Therefore 16700 microseconds = "16.7" milliseconds.
Also, note that it may be more clear to compare actual sf::Times rather than floats:
if (elapsed1 >= sf::microseconds(16700))