Replace vTaskDelay with vTaskDelayUntil in record_system