How would I stop a while loop after n amount of time?

I want to terminate the loop at a set time so that the remaining code runs. I found that the @time can only show the time when that part of code was completely compiled.

https://stackoverflow.com/questions/51264467/timeout-function-in-julia

1 Like