Your solution is just perfect!
The system has to run in "real-time" as it is meant to be a didactic simulation. The problem was that I coupled my precision with my looptime! When I increased my precision, I also decreased my looptime so everything had to run fast. In your solution, only the relay has to run fast while the drawing can run at the standard 100ms rate.
Now I can view the system in real-time with a CPU load of 50%
Thank you very much for your help!
Greetings,
Cedric.