Skip to content

Instantly share code, notes, and snippets.

@albertlai431
Created May 13, 2019 20:37
Show Gist options
  • Save albertlai431/db1ab78ae44641eddf1d42eb424863e3 to your computer and use it in GitHub Desktop.
Save albertlai431/db1ab78ae44641eddf1d42eb424863e3 to your computer and use it in GitHub Desktop.
stock = [] #keeping track of all the averages
benchmark = 0 #Use this to store the final focus metric
while True:
data, addr = sock.recvfrom(1024) #receiving data from socket
if 'alpha_absolute' in str(data): #checking for alpha
#preprocessing data here
if time.clock() - timer > 30:
benchmark = sum(stock)/len(stock) #determining the benchmark!
timer = time.clock() #resets the clock
stock = [] #resets the average tracking
winsound.Beep(frequency, duration) #plays a beep sound to tell the user it's over
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment