Skip to main content

timeHasExpired

Short summary

This assertion method checks whether time has elapsed since the timestamp time

Parameters

NameTypeCommentKind
timestampLTIMEstart time you get it with LTIME()input
expiringTimeLTIMEtimeout like lt#300msinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD timeHasExpired
VAR_INPUT
(* start time you get it with ``LTIME()`` *)
timestamp :LTIME;
(* timeout like ``lt#300ms`` *)
expiringTime :LTIME;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR
VAR
(* measured passed time *)
passedTime :LTIME;
END_VAR

Implementation

passedTime := THIS^.getTimePassed(timestamp);
IF (passedTime < expiringTime) THEN
THIS^.assertionWasWrong(
message := message,
additionalText := THIS^.getDebugInfo('timeHasExpired')
);
END_IF