Reasonable time is determined by case law, and when it's a judge deciding, it's the judge's estimation of what a reasonable juror in that jurisdiction would think about the case. It's not as woozy as it seems, and is usually called an objective standard in the legal jargon. It's something that could conceivably be determined by a computer looking at all the factors that a judge would look at, and/or the relevant jury instructions that might frame the issue for a jury.