I would like to run a numerical experiment for as much as it can run in a reasonable time.
This is a sketch of how I currently do it:
results = Reap[
Do[
If[testQ @ k,
Sow[transformation @ k]
]
, {k, 2, 1000}]]
I would like to get as much data as possible. If I set the upper bound to 1000, I'll say "that was fast". I set it to 10000 - ok, a bit longer. I set it to 100000 - "hmm, is it ever going to finish or should I kill it?"
What I would like is to set the upper bound to something really big or infinite and just press some Alt+.
or other key combination to kill it when I'm tired of waiting.
How should I do it? Should I write in a file instead of Sowing? Or is there something intended for this purpose?
TimeConstrained
? As inTimeConstrained[ your code here , your boredom threshold here ]
.result
will still get everything youSow
ed. $\endgroup$