diff --git a/include/simfil/environment.h b/include/simfil/environment.h index 2a83b39..4ed5046 100644 --- a/include/simfil/environment.h +++ b/include/simfil/environment.h @@ -149,14 +149,14 @@ struct Context Phase phase = Evaluation; /* Timeout after which the evaluation should be canceled. */ - std::chrono::time_point timeout = std::chrono::time_point::max(); + std::optional> timeout; Context(Environment* env, Phase = Phase::Evaluation); auto canceled() const -> bool { - if (phase != Phase::Compilation) - return timeout < std::chrono::steady_clock::now(); + if (phase != Phase::Compilation && timeout) + return *timeout < std::chrono::steady_clock::now(); return false; } };