# Break function on time limit

**URL:** https://discourse.julialang.org/t/break-function-on-time-limit/7376
**Category:** General Usage
**Created:** [November 29, 2017, 12:38am UTC](https://discourse.julialang.org/t/break-function-on-time-limit/7376 "2017-11-29T00:38:30Z")
**Posts on this page:** 1
**Showing post:** 23

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [June 9, 2020, 11:34pm UTC](https://discourse.julialang.org/t/break-function-on-time-limit/7376/23 "2020-06-09T23:34:45Z")

</div>

I ended up using a similar mechanism. Trying to use `Distributed` only brought headaches. [Nobody answered my question about killing workers in a guaranteed way.](https://discourse.julialang.org/t/should-julia-be-able-to-really-kill-a-worker/39564) In the end was far easier to create a new Exception type, propagate a deadline through a good part of code, and in key points call a function that checks the deadline and throws if it was violated. I solved the problem with the solver time limit by changing the solver time limit to exactly the remaining time before deadline when I call solve, and then checking for the deadline right after.

---

_[View the full topic](https://discourse.julialang.org/t/break-function-on-time-limit/7376)._
