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 {
199
199
return endTime.getProcessTime () - StartTime.getProcessTime ();
200
200
}
201
201
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
+
202
209
// Disable emission of warnings about expressions that take longer
203
210
// than the warning threshold.
204
211
void disableWarning () { PrintWarning = false ; }
205
212
206
213
bool isExpired () const {
207
- auto elapsed = getElapsedProcessTimeInFractionalSeconds ();
208
- return unsigned (elapsed) > ThresholdInMillis;
214
+ return getRemainingProcessTimeInMillis () == 0 ;
209
215
}
210
216
};
211
217
You can’t perform that action at this time.
0 commit comments