File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -199,13 +199,19 @@ class ExpressionTimer {
199199 return endTime.getProcessTime () - StartTime.getProcessTime ();
200200 }
201201
202+ // / Return the remaining process time in milliseconds until the
203+ // / threshold specified during construction is reached.
204+ unsigned getRemainingProcessTimeInMillis () const {
205+ auto elapsed = unsigned (getElapsedProcessTimeInFractionalSeconds ());
206+ return elapsed >= ThresholdInMillis ? 0 : ThresholdInMillis - elapsed;
207+ }
208+
202209 // Disable emission of warnings about expressions that take longer
203210 // than the warning threshold.
204211 void disableWarning () { PrintWarning = false ; }
205212
206213 bool isExpired () const {
207- auto elapsed = getElapsedProcessTimeInFractionalSeconds ();
208- return unsigned (elapsed) > ThresholdInMillis;
214+ return getRemainingProcessTimeInMillis () == 0 ;
209215 }
210216};
211217
You can’t perform that action at this time.
0 commit comments