Package jline.util
Class LineTimeout
java.lang.Object
jline.util.LineTimeout
Session-level cooperative wall-clock budget (port of MATLAB
lineTimeoutExceeded's global-deadline form). A per-solver runAnalyzer with a
finite options.timeout arms the deadline and clears it in a finally block;
deep utility loops with no options argument (e.g. multichoose during CTMC
state-space generation) poll
checkpoint(String) at safe points and
abort with a RuntimeException, since a partially enumerated state space
would silently yield wrong results.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckpoint(String context) Amortized checkpoint for hot loops: polls the clock once every 256 calls and throws when the armed deadline has passed.static voidclear()Disarm the deadline.static booleanexceeded()True if a deadline is armed and has passed.static voidset(double budgetSeconds) Arm the deadline; a non-finite or non-positive budget disarms it.
-
Method Details
-
set
public static void set(double budgetSeconds) Arm the deadline; a non-finite or non-positive budget disarms it. -
clear
public static void clear()Disarm the deadline. -
exceeded
public static boolean exceeded()True if a deadline is armed and has passed. -
checkpoint
Amortized checkpoint for hot loops: polls the clock once every 256 calls and throws when the armed deadline has passed. The stride is low because callers do heavy matrix work between calls (multichoose concatenations), so a large stride overshoots the budget by minutes.
-