The Operating mechanism of a snap app

emmmmm… I have made a snap app about the operation of fan which use the python3 as the language.

Everything seems to be OK (I can open or close the wind by accessing and controling the gpio pins).

But there is a small problem that it will exist a delay of a few seconds between running the program and turning on the fan.

I have tried to use the “top” command to find what happened after the command executed,and I saw that the “python3” was running and after that the fan was turned on.

So my problem is what happened after executing the snap cammond like “fanApp.open”,what’s the operating mechanism of a snap app,where can I find the answer about that??

Looking forward to the answer. Thanks