On Saturday, 17 November 2018 at 06:19:25 UTC, Alex wrote:
It can happen, that the input params are correct, however, the calculation lasts too long. Is there a way, to measure the execution time of foo (รก la benchmark) and then, if some execution time limit is exceeded to interrupt the calculation? At best, with a flag, whether foo ended normally or because of the interruption.

You could run the calculation in another thread and use std.concurrency.receiveTimeout [1] to stop waiting for the result after a certain amount of time.

[1] https://dlang.org/phobos/std_concurrency.html#.receiveTimeout

Reply via email to