Refactored timing loop to be more resilient against skipped data points