Modifications

Sauter à la navigation Sauter à la recherche
Ligne 310 : Ligne 310 :     
The main loop is composed of an infinite {{fname|while}} loop.
 
The main loop is composed of an infinite {{fname|while}} loop.
 +
 +
<syntaxhighlight lang="python">
 +
# Iteration counter
 +
counter = 1
 +
# ctime contains the time (in seconds) when the script was stared
 +
ctime = time.time() # Now
 +
while True:
 +
    # Main Loop Content
 +
    ...
 +
    ...
 +
    ...
 +
    counter += 1    # increment iteration counter
 +
    time.sleep(0.4) # wait 0.4 second between iterations
 +
</syntaxhighlight>
    
== Fault tolerant design ==
 
== Fault tolerant design ==
29 917

modifications

Menu de navigation