PaperZD time untill playing animation

Hello!
Noob question
So I want to make a waiting animation. If the player doesn’t do anything for like 10 seconds (like in sonic 2d games he starts to get really annoyed if the player is afk), animation of idle should switch to the waiting one.


The problem is - I have no idea how to implement the time counting. Tried to do it via variable, that was set to 10 (seconds I hope), but couldn’t find a way to count the time from the start of the idle animation. Any advice?