Your code seems fine now, except that you should update your elapsed variable inside the loop (read it from your clock).
Currently your just reading it once, and comparing that static value to 4 a lot of times.
The time type represents a point in time, and is hence static.
Your code should be;
...
while(renderWindow.pollEvent(event))
{
elapsed = clock.getElapsedTime();
// Rest of the loop code
...
}