As I mentioned on Discord already, using multiple clear, draw, display for a single frame is not a solution. It flickers because of double buffering.
Instead you have to adjust your game loop. Too bad you didn't provide an actual minimal example, because now I have to basically write all the code to help you...
#include <SFML/Graphics.hpp>
#include <random>
int main()
{
sf::RenderWindow window{ {800, 600}, "SFML window" };
window.setFramerateLimit(60);
sf::CircleShape white_dot{ 20.f };
white_dot.setFillColor(sf::Color::White);
white_dot.setPosition({ 100.f, 100.f });
sf::CircleShape red_dot{ 5.f };
red_dot.setFillColor(sf::Color::Red);
red_dot.setPosition({ 400.f, 300.f });
std::random_device random_device;
std::mt19937 generator(random_device());
std::uniform_real_distribution<float> x_distribution{ 0.f, 800.f };
std::uniform_real_distribution<float> y_distribution{ 0.f, 600.f };
sf::Clock clock;
auto display_white_dot = false;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
else if (event.type == sf::Event::MouseButtonReleased)
{
clock.restart();
display_white_dot = true;
white_dot.setPosition({ x_distribution(generator), y_distribution(generator) });
}
}
if (display_white_dot && clock.getElapsedTime().asMilliseconds() > 200)
{
display_white_dot = false;
}
window.clear(sf::Color{ 100, 100, 100 });
window.draw(red_dot);
if (display_white_dot)
{
window.draw(white_dot);
}
window.display();
}
}
The main change here was to use a boolean to track the state of displaying or not displaying. Then change the boolean when the clock is passed 200ms.
Just for fun I added random position generation.
This looks like some kind of reaction test, is it?