You are here: Elements > Frame Recognizers > Handling Timer Events

Handling Timer Events

The @TIMER block is called once per second. When a call comes to your @TIMER block, you typically want to check the value in i64Timestamp. For example, you can save the timestamp value into a member variable each time a character is received then, when the @TIMER call comes, compare that with the current i64Timestamp, decide if it is appropriate to time out the frame and proceed appropriately. This is facilitated by the fact that i64Timestamp is provided to the @SIGNAL_CHANGE and @EACH_BYTE blocks in addition to @TIMER. You can also use the @TIMER block to check for an idle line by counting the number of ticks since the last byte was received. For example, if the @TIMER block is called 5 times since the last byte was received, you can assume that the line has been idle for 5 seconds.