Check for user interrupt during sampling and optimization