Skip to content

Instantly share code, notes, and snippets.

@inmcm
Created December 18, 2014 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inmcm/179e31c3890349c4aad9 to your computer and use it in GitHub Desktop.
Save inmcm/179e31c3890349c4aad9 to your computer and use it in GitHub Desktop.
#Get Average Time in micros for the final Sentence Parsing
#Get Average Time in micros for the final Sentence Parsing
from micropyGPS import MicropyGPS
sentence1 = '$GPRMC,181714.898,A,3748.8617,N,08338.9530,W,000.0,237.0,240911,,,A*79'
sentence2 = '$GPGGA,181715.898,3748.8604,N,08338.9539,W,1,09,0.9,371.4,M,-32.5,M,,0000*60'
sentence3 = '$GPGSA,A,3,07,11,28,24,26,08,04,17,20,,,,1.7,0.9,1.4*3F'
sentence4 = '$GPGSV,3,1,12,28,76,017,38,17,56,282,38,01,46,055,40,08,38,183,47*75'
my_gps = MicropyGPS()
start = 0
stop = 0
avg = 0
print('testing')
for y in range(500):
for x in sentence1:
start = pyb.micros()
if my_gps.update(x):
stop = pyb.micros()
avg += stop - start
print(avg // 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment