-
-
Save mr5z/bcc355ffee505d27e2c34e8edde1c328 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void LocationChanged(object sender, PositionEventArgs e) | |
{ | |
if (stopWatch == null) { | |
stopWatch = Stopwatch.StartNew(); | |
} | |
var position = e.Position; | |
if (UnixTimeStamp > previousUpdateTime + MinUpdateTime) { | |
stopWatch.Stop(); | |
Log("location: ({0}, {1}), lapsed time: {2}", position.Latitude, position.Longitude, stopWatch.ElapsedMilliseconds); | |
previousUpdateTime = UnixTimeStamp; | |
} | |
else { | |
skippedLocationsCount++; | |
Log("location skipped count: {0}", skippedLocationsCount); | |
if (!stopWatch.IsRunning) { | |
stopWatch.Restart(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment