Resettable timer

#1

Sometimes the oneshot timer may need to be set back. For example when we are checking a user’s inactivity that is interrupted by an interaction.

API: timer.reset(handle)

0 Likes

#2

Isn’t it enough to cancel it and create it again?

I think it’s sometimes important to recognise that each tiny added function adds to the size of the engine.

3 Likes

#3

Naturally deletion and re-creation would be sufficient in normal circumstances, but i think -considering the resource consumption- it would be more effective if the internal state of the existing timer would be zeroed. From engine perspective, implementing this function shouldn’t cause big increase in its size.

0 Likes

#4

What do you mean by this? Have you made measurements and found that cancelling and starting a timer is expensive?

0 Likes