Start a script automatically

Hi, I’m new in Elixir and I found difficult to understand GenServer and Supervisors.
I want to put this code to start automatically and run forever. The idea is always check the difference of times given an old time. I really need to use a GenServer here? Could you guys give me an simple example of supervisors and the flow with GenServer?

Image

Thank you!

Have you read the official guide? Introduction - The Elixir programming language

If you find the official guide difficult to follow, then you need to read a book or follow an interactive tutorial. I doubt anyone here can explain a general concept better than the official guide. The forum is better for specific questions.